|
@@ -22,6 +22,10 @@
|
|
|
#include "alarm_task.h"
|
|
|
#include "api.h"
|
|
|
#include "storage.h"
|
|
|
+#include "cleanup_task.h"
|
|
|
+
|
|
|
+
|
|
|
+static const char* STORAGE_NAMESPACE = "a1";
|
|
|
|
|
|
static void IRAM_ATTR gpio_interrupt_handler(void *args)
|
|
|
{
|
|
@@ -37,7 +41,7 @@ static void init_peripherals(uint8_t* button_pressed_flag) {
|
|
|
wifi_init();
|
|
|
wifi_start();
|
|
|
|
|
|
- ESP_ERROR_CHECK(storage_init("a1"));
|
|
|
+ ESP_ERROR_CHECK(storage_init(STORAGE_NAMESPACE));
|
|
|
ds3231_init(DS3231_SDA_PIN, DS3231_SCL_PIN);
|
|
|
tm1637_init(TM1637_CLK_PIN, TM1637_DIO_PIN, true, 1);
|
|
|
|
|
@@ -72,6 +76,7 @@ void app_main(void) {
|
|
|
await_sntp_sync();
|
|
|
}
|
|
|
|
|
|
- xTaskCreate(display_update_task, "display_update_task", 2048, NULL, 7, NULL);
|
|
|
+ xTaskCreate(display_update_task, "display_update_task", 2048, NULL, 8, NULL);
|
|
|
xTaskCreate(alarm_task, "alarm_task", 2048, (void*) &alarm_task_parameters, 7, NULL);
|
|
|
+ xTaskCreate(cleanup_task, "cleanup_task", 2048, STORAGE_NAMESPACE, 8, NULL);
|
|
|
}
|