From 320fdeb9d8355d3c361d5c6d60de8afc64501af9 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 30 Aug 2023 16:48:10 +1000 Subject: Use a service locator instead of passing around subsets of drivers between FSMs --- src/system_fsm/include/system_fsm.hpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (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 371e5527..28448e5a 100644 --- a/src/system_fsm/include/system_fsm.hpp +++ b/src/system_fsm/include/system_fsm.hpp @@ -18,6 +18,7 @@ #include "nvs.hpp" #include "relative_wheel.hpp" #include "samd.hpp" +#include "service_locator.hpp" #include "storage.hpp" #include "tag_parser.hpp" #include "tinyfsm.hpp" @@ -60,22 +61,8 @@ class SystemState : public tinyfsm::Fsm { protected: auto IdleCondition() -> bool; - static std::shared_ptr sGpios; - static std::shared_ptr sSamd; - static std::shared_ptr sNvs; - - static std::shared_ptr sTouch; - static std::shared_ptr sRelativeTouch; - 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; - - static std::shared_ptr sDatabase; - static std::shared_ptr sTagParser; - - static std::shared_ptr sTrackQueue; + static std::shared_ptr sServices; + static std::unique_ptr sStorage; static console::AppConsole* sAppConsole; }; -- cgit v1.2.3