From 8ff93f5467b0eef54d18b35d742de05c8a63da9a Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 28 Aug 2023 10:18:02 +1000 Subject: Make idle state more robust + check playback state --- src/system_fsm/include/system_fsm.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/system_fsm/include/system_fsm.hpp') diff --git a/src/system_fsm/include/system_fsm.hpp b/src/system_fsm/include/system_fsm.hpp index 6baceca1..a556be9e 100644 --- a/src/system_fsm/include/system_fsm.hpp +++ b/src/system_fsm/include/system_fsm.hpp @@ -9,6 +9,7 @@ #include #include "app_console.hpp" +#include "audio_events.hpp" #include "battery.hpp" #include "bluetooth.hpp" #include "database.hpp" @@ -54,9 +55,12 @@ class SystemState : public tinyfsm::Fsm { virtual void react(const StorageMounted&) {} virtual void react(const StorageError&) {} virtual void react(const KeyLockChanged&) {} + virtual void react(const audio::PlaybackFinished&) {} virtual void react(const internal::IdleTimeout&) {} protected: + auto IdleCondition() -> bool; + static std::shared_ptr sGpios; static std::shared_ptr sSamd; static std::shared_ptr sNvs; @@ -101,6 +105,8 @@ class Running : public SystemState { void react(const KeyLockChanged&) override; void react(const StorageError&) override; + void react(const audio::PlaybackFinished&) override; + using SystemState::react; }; -- cgit v1.2.3