This commit is contained in:
2024-06-14 15:28:23 +03:00
parent 7339f1544b
commit 11d30d29f4
3 changed files with 8 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ static const char *TAG = "zh_dht";
static esp_err_t _read_bit(const zh_dht_handle_t *dht_handle, bool *bit);
zh_dht_handle_t zh_dht_init(const zh_dht_sensor_type_t sensor_type, const uint8_t sensor_pin)
zh_dht_handle_t zh_dht_init(const zh_dht_sensor_type_t sensor_type, const uint8_t *sensor_pin)
{
ESP_LOGI(TAG, "DHT initialization begin.");
zh_dht_handle_t zh_dht_handle = {
@@ -34,7 +34,7 @@ zh_dht_handle_t zh_dht_init(const zh_dht_sensor_type_t sensor_type, const uint8_
gpio_config_t config = {0};
config.intr_type = GPIO_INTR_DISABLE;
config.mode = GPIO_MODE_INPUT;
config.pin_bit_mask = (1ULL << sensor_pin);
config.pin_bit_mask = (1ULL << *sensor_pin);
config.pull_down_en = GPIO_PULLDOWN_DISABLE;
config.pull_up_en = GPIO_PULLUP_ENABLE;
if (gpio_config(&config) != ESP_OK)