diff options
| author | ailurux <ailuruxx@gmail.com> | 2023-08-28 14:59:52 +1000 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2023-08-28 14:59:52 +1000 |
| commit | db601935c6145445467692c0a4ff2b81e27cf6ce (patch) | |
| tree | e2eed4a38abd03f14dba504ce5e8dedee0da6a12 /src/system_fsm/running.cpp | |
| parent | 6f4ace1dd4b9b34f95af1ba365b68624e209d147 (diff) | |
| parent | 3a0c42f9240eedfbc6a1e94ad3a59c52664fb5b5 (diff) | |
| download | tangara-fw-db601935c6145445467692c0a4ff2b81e27cf6ce.tar.gz | |
Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw
Diffstat (limited to 'src/system_fsm/running.cpp')
| -rw-r--r-- | src/system_fsm/running.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/system_fsm/running.cpp b/src/system_fsm/running.cpp index 9e250c9b..3fc5493f 100644 --- a/src/system_fsm/running.cpp +++ b/src/system_fsm/running.cpp @@ -5,6 +5,7 @@ */ #include "app_console.hpp" +#include "audio_events.hpp" #include "file_gatherer.hpp" #include "freertos/projdefs.h" #include "result.hpp" @@ -68,7 +69,13 @@ void Running::exit() { } void Running::react(const KeyLockChanged& ev) { - if (!ev.falling && audio::AudioState::is_in_state<audio::states::Standby>()) { + if (IdleCondition()) { + transit<Idle>(); + } +} + +void Running::react(const audio::PlaybackFinished& ev) { + if (IdleCondition()) { transit<Idle>(); } } |
