From 4cd3c187f92d8f5b73c2c985da308280c18465cf Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 20 Mar 2024 11:08:35 +1100 Subject: Add exact display size to nvs, since it can vary --- src/system_fsm/booting.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/system_fsm/booting.cpp') diff --git a/src/system_fsm/booting.cpp b/src/system_fsm/booting.cpp index 41f46df2..14fed92e 100644 --- a/src/system_fsm/booting.cpp +++ b/src/system_fsm/booting.cpp @@ -62,8 +62,12 @@ auto Booting::entry() -> void { ESP_ERROR_CHECK(drivers::init_spi()); sServices->gpios(std::unique_ptr(drivers::Gpios::Create())); + // NVS is needed early so that we can correctly initialise the display. + sServices->nvs( + std::unique_ptr(drivers::NvsStorage::OpenSync())); + ESP_LOGI(kTag, "starting ui"); - if (!ui::UiState::InitBootSplash(sServices->gpios())) { + if (!ui::UiState::InitBootSplash(sServices->gpios(), sServices->nvs())) { events::System().Dispatch(FatalError{}); return; } @@ -74,8 +78,6 @@ auto Booting::entry() -> void { ESP_LOGI(kTag, "installing remaining drivers"); drivers::spiffs_mount(); sServices->samd(std::unique_ptr(drivers::Samd::Create())); - sServices->nvs( - std::unique_ptr(drivers::NvsStorage::OpenSync())); sServices->touchwheel( std::unique_ptr{drivers::TouchWheel::Create()}); sServices->haptics(std::make_unique()); -- cgit v1.2.3