Add NVS storage handler and integrate with main application logic

This commit is contained in:
GW_MC
2026-01-18 14:46:25 +08:00
parent e458256193
commit d339a1f4c3
7 changed files with 135 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
//
#include "common/constants.h"
#include "common/queue_defs.h"
#include "io/nvs_handler.h"
#include "info/info.h"
#include "display/display.h"
#include "touch/touch.h"
@@ -49,9 +50,11 @@ void app_main(void) {
throw std::runtime_error("Failed to create LVGL mutex");
}
//
KVStorageHandler* kv_storage_handler = new NVSStorageHandler();
DisplayHandler* display_handler = new EInkDisplayHandler(touch_event_queue, lvgl_mutex);
TouchHandler* touch_handler = new EInkTouchHandler(touch_event_queue);
//
kv_storage_handler->init(system_event_group);
display_handler->init(system_event_group);
touch_handler->init(system_event_group);
//
@@ -75,7 +78,8 @@ void app_main(void) {
printf("Waiting for system to be ready...\n");
xEventGroupWaitBits(
system_event_group,
DISPLAY_READY_BIT | TOUCH_CALIBRATED_BIT,
DISPLAY_READY_BIT | TOUCH_CALIBRATED_BIT | STORAGE_READY_BIT,
// do not clear on exit, require explicit reset
pdFALSE,
pdTRUE,
portMAX_DELAY