diff --git a/README.md b/README.md index 4a176ac..5ed89f8 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ 1. ESP8266 RTOS_SDK v3.4 2. ESP32 ESP-IDF v5.2 -## [Function description](http://zh-dht.zh.com.ru) - ## Using In an existing project, run the following command to install the component: @@ -33,8 +31,8 @@ void app_main(void) { esp_log_level_set("zh_dht", ESP_LOG_NONE); zh_dht_handle_t dht_handle = zh_dht_init(ZH_DHT22, GPIO_NUM_5); - float humidity; - float temperature; + float humidity = 0.0; + float temperature = 0.0; for (;;) { zh_dht_read(&dht_handle, &humidity, &temperature); diff --git a/include/zh_dht.h b/include/zh_dht.h index 688969e..4d08eb4 100644 --- a/include/zh_dht.h +++ b/include/zh_dht.h @@ -1,9 +1,3 @@ -/** - * @file - * Header file for the zh_dht component. - * - */ - #pragma once #include "stdint.h" @@ -18,24 +12,17 @@ extern "C" { #endif - /** - * @brief Enumeration of supported sensor types. - * - */ - typedef enum + + typedef enum // Enumeration of supported sensor types. { - ZH_DHT11, ///< Sensor type DHT11. - ZH_DHT22 ///< Sensor type DHT22 or AM2302. + ZH_DHT11, // Sensor type DHT11. + ZH_DHT22 // Sensor type DHT22 or AM2302. } zh_dht_sensor_type_t; - /** - * @brief Unique handle of the sensor. - * - */ - typedef struct + typedef struct // Unique handle of the sensor. { - uint8_t sensor_pin; ///< Sensor GPIO connection. @note - zh_dht_sensor_type_t sensor_type; ///< Sensor type. @note + uint8_t sensor_pin; // Sensor GPIO connection. + zh_dht_sensor_type_t sensor_type; // Sensor type. } zh_dht_handle_t; /** diff --git a/zh_dht.c b/zh_dht.c index 58a50ae..b7ea2a3 100644 --- a/zh_dht.c +++ b/zh_dht.c @@ -1,12 +1,5 @@ -/** - * @file - * The main code of the zh_dht component. - * - */ - #include "zh_dht.h" -/// \cond #define BIT_1_TRANSFER_MAX_DURATION 75 // Signal "1" high time. #define BIT_0_TRANSFER_MAX_DURATION 30 // Signal "0" high time. #define DATA_BIT_START_TRANSFER_MAX_DURATION 55 // Signal "0", "1" low time. @@ -19,7 +12,6 @@ #else #define esp_delay_us(x) esp_rom_delay_us(x) #endif -/// \endcond static const char *TAG = "zh_dht";