From 0ea358ab8157d743dc07f12bde5fb34d03a02522 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 13 Sep 2023 10:09:04 +1000 Subject: Make the onboarding flow basically work. Much still to do! --- src/system_fsm/running.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/system_fsm/running.cpp') diff --git a/src/system_fsm/running.cpp b/src/system_fsm/running.cpp index e42429e7..70b4e99c 100644 --- a/src/system_fsm/running.cpp +++ b/src/system_fsm/running.cpp @@ -35,6 +35,15 @@ void Running::entry() { auto storage_res = drivers::SdStorage::Create(sServices->gpios()); if (storage_res.has_error()) { ESP_LOGW(kTag, "failed to mount!"); + switch (storage_res.error()) { + case drivers::SdStorage::FAILED_TO_MOUNT: + sServices->sd(drivers::SdState::kNotFormatted); + break; + case drivers::SdStorage::FAILED_TO_READ: + default: + sServices->sd(drivers::SdState::kNotPresent); + break; + } events::System().Dispatch(StorageError{}); events::Audio().Dispatch(StorageError{}); @@ -42,6 +51,7 @@ void Running::entry() { return; } sStorage.reset(storage_res.value()); + sServices->sd(drivers::SdState::kMounted); ESP_LOGI(kTag, "opening database"); sFileGatherer = new database::FileGathererImpl(); -- cgit v1.2.3