Added a random error checking function
Not actually sure I'll use it?
This commit is contained in:
12
main/main.c
12
main/main.c
@@ -20,8 +20,8 @@ static const char* TAG = "YASPAM";
|
||||
static volatile bool run_dht = true;
|
||||
static volatile bool run_pms5003 = true;
|
||||
|
||||
static TaskHandle_t dht22_handle;
|
||||
static TaskHandle_t pms5003_handle;
|
||||
static TaskHandle_t dht22_handle = NULL;
|
||||
static TaskHandle_t pms5003_handle = NULL;
|
||||
|
||||
#ifdef CONFIG_PMS5003_ENABLED
|
||||
#include "pms5003.h"
|
||||
@@ -49,8 +49,12 @@ read_from_dht22()
|
||||
portDISABLE_INTERRUPTS();
|
||||
int ret = dht22_read();
|
||||
portENABLE_INTERRUPTS();
|
||||
ESP_LOGI(TAG, "Got DHT22 data!");
|
||||
// TODO: Write the data out somewhere - into RAM maybe?
|
||||
if (ret != DHT22_OK) {
|
||||
dht22_handle_error(ret);
|
||||
} else {
|
||||
ESP_LOGI(TAG, "Got DHT22 data!");
|
||||
// TODO: Write the data out somewhere - into RAM maybe?
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(CONFIG_DHT22_PERIOD_POLL));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user