diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2025-03-12 23:51:40 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-03-12 23:51:40 +0000 |
| commit | fe38a57120145f73abf170400fe4a0eb0fd2714a (patch) | |
| tree | 80c2ca8003fe32e59eccf2e208a53e1e87c66790 /src/tangara/system_fsm/running.cpp | |
| parent | 42c2a4f2445ff56a2a0a78c4ef265e5be346d40d (diff) | |
| parent | 9fdf94e9cee5a5180ffefc2b8314f7a9879ebbc6 (diff) | |
| download | tangara-fw-fe38a57120145f73abf170400fe4a0eb0fd2714a.tar.gz | |
Merge pull request 'Allow manually unmounting the SD card' (#271) from ayumi/tangara-fw:unmount into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/271
Diffstat (limited to 'src/tangara/system_fsm/running.cpp')
| -rw-r--r-- | src/tangara/system_fsm/running.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/tangara/system_fsm/running.cpp b/src/tangara/system_fsm/running.cpp index 13f58ef9..87b7f1ac 100644 --- a/src/tangara/system_fsm/running.cpp +++ b/src/tangara/system_fsm/running.cpp @@ -59,9 +59,22 @@ void Running::react(const database::event::UpdateFinished&) { checkIdle(); } +void Running::react(const ui::UnmountRequest& ev) { + events::Audio().Dispatch(audio::TogglePlayPause{.set_to = false}); + events::Audio().Dispatch(UnmountRequest{.idle = false}); +} + +void Running::react(const audio::UnmountReady& ev) { + if (ev.idle) { + transit<Idle>(); + } else { + unmountStorage(); + } +} + void Running::react(const internal::UnmountTimeout&) { if (IdleCondition()) { - transit<Idle>(); + events::Audio().Dispatch(UnmountRequest{.idle = true}); } } |
