Added a random error checking function

Not actually sure I'll use it?
This commit is contained in:
2023-10-25 22:11:04 +01:00
parent ce0de58466
commit e8c1dc0647
3 changed files with 18 additions and 5 deletions

View File

@@ -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));
}
}