From 3a0c42f9240eedfbc6a1e94ad3a59c52664fb5b5 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 28 Aug 2023 13:26:53 +1000 Subject: Move battery measurement to its own class --- src/system_fsm/include/system_events.hpp | 4 +--- src/system_fsm/include/system_fsm.hpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (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 8a3ba5ec..64cbd393 100644 --- a/src/system_fsm/include/system_events.hpp +++ b/src/system_fsm/include/system_events.hpp @@ -53,7 +53,7 @@ struct HasPhonesChanged : tinyfsm::Event { }; struct ChargingStatusChanged : tinyfsm::Event {}; -struct BatteryPercentChanged : tinyfsm::Event {}; +struct BatteryStateChanged : tinyfsm::Event {}; namespace internal { @@ -62,8 +62,6 @@ 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 a556be9e..371e5527 100644 --- a/src/system_fsm/include/system_fsm.hpp +++ b/src/system_fsm/include/system_fsm.hpp @@ -48,7 +48,6 @@ 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&) {} @@ -67,7 +66,8 @@ class SystemState : public tinyfsm::Fsm { static std::shared_ptr sTouch; static std::shared_ptr sRelativeTouch; - static std::shared_ptr sBattery; + static std::shared_ptr sAdc; + static std::shared_ptr sBattery; static std::shared_ptr sStorage; static std::shared_ptr sDisplay; static std::shared_ptr sBluetooth; -- cgit v1.2.3