From ee949829d98c3b8df685319559a5798aad74bf13 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 22 Aug 2023 15:55:25 +1000 Subject: Add battery % with change events --- src/system_fsm/include/system_events.hpp | 3 +++ src/system_fsm/include/system_fsm.hpp | 1 + 2 files changed, 4 insertions(+) (limited to 'src/system_fsm/include') diff --git a/src/system_fsm/include/system_events.hpp b/src/system_fsm/include/system_events.hpp index f62da801..8a3ba5ec 100644 --- a/src/system_fsm/include/system_events.hpp +++ b/src/system_fsm/include/system_events.hpp @@ -53,6 +53,7 @@ struct HasPhonesChanged : tinyfsm::Event { }; struct ChargingStatusChanged : tinyfsm::Event {}; +struct BatteryPercentChanged : tinyfsm::Event {}; namespace internal { @@ -61,6 +62,8 @@ struct SamdInterrupt : tinyfsm::Event {}; struct IdleTimeout : tinyfsm::Event {}; +struct BatteryTimerFired : tinyfsm::Event {}; + } // namespace internal } // namespace system_fsm diff --git a/src/system_fsm/include/system_fsm.hpp b/src/system_fsm/include/system_fsm.hpp index 0698be9b..6baceca1 100644 --- a/src/system_fsm/include/system_fsm.hpp +++ b/src/system_fsm/include/system_fsm.hpp @@ -47,6 +47,7 @@ class SystemState : public tinyfsm::Fsm { void react(const FatalError&); void react(const internal::GpioInterrupt&); void react(const internal::SamdInterrupt&); + void react(const internal::BatteryTimerFired&); virtual void react(const DisplayReady&) {} virtual void react(const BootComplete&) {} -- cgit v1.2.3