diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-03-20 11:08:35 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-03-20 11:08:35 +1100 |
| commit | 4cd3c187f92d8f5b73c2c985da308280c18465cf (patch) | |
| tree | f4c9dd27fa3c760aab4d5b29bb442588e2ad643f /src/system_fsm | |
| parent | edd5eecc14bd5f7f25446555459836dd10f2af33 (diff) | |
| download | tangara-fw-4cd3c187f92d8f5b73c2c985da308280c18465cf.tar.gz | |
Add exact display size to nvs, since it can vary
Diffstat (limited to 'src/system_fsm')
| -rw-r--r-- | src/system_fsm/booting.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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>(drivers::Gpios::Create())); + // NVS is needed early so that we can correctly initialise the display. + sServices->nvs( + std::unique_ptr<drivers::NvsStorage>(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>(drivers::Samd::Create())); - sServices->nvs( - std::unique_ptr<drivers::NvsStorage>(drivers::NvsStorage::OpenSync())); sServices->touchwheel( std::unique_ptr<drivers::TouchWheel>{drivers::TouchWheel::Create()}); sServices->haptics(std::make_unique<drivers::Haptics>()); |
