diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-08-21 15:43:23 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-08-21 15:43:23 +1000 |
| commit | 764b01e913d0123747757e5efd3545d46e921848 (patch) | |
| tree | 76f0a1d2afb4b60818cc46fd5649938713f2f261 /src/system_fsm/booting.cpp | |
| parent | 27f329a9dbf18a046ade534c9330b03e586cdb98 (diff) | |
| download | tangara-fw-764b01e913d0123747757e5efd3545d46e921848.tar.gz | |
Add idle->standby support when locked and no music
Diffstat (limited to 'src/system_fsm/booting.cpp')
| -rw-r--r-- | src/system_fsm/booting.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/system_fsm/booting.cpp b/src/system_fsm/booting.cpp index 6720fb4a..27f2b9c9 100644 --- a/src/system_fsm/booting.cpp +++ b/src/system_fsm/booting.cpp @@ -94,13 +94,11 @@ auto Booting::exit() -> void { auto Booting::react(const BootComplete& ev) -> void { ESP_LOGI(kTag, "bootup completely successfully"); - // It's possible that the SAMD is currently exposing the SD card as a USB - // device. Make sure we don't immediately try to claim it. - if (sSamd && - sSamd->GetUsbStatus() == drivers::Samd::UsbStatus::kAttachedMounted) { - transit<Unmounted>(); + if (sGpios->Get(drivers::Gpios::Pin::kKeyLock)) { + transit<Running>(); + } else { + transit<Idle>(); } - transit<Running>(); } } // namespace states |
