From a6ab1504058304012791281f9eb42c262745888f Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 19 May 2023 21:21:27 +1000 Subject: Add tinyfsm, start converting core functions to an FSM-based event loop --- src/drivers/driver_cache.cpp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/drivers/driver_cache.cpp (limited to 'src/drivers/driver_cache.cpp') diff --git a/src/drivers/driver_cache.cpp b/src/drivers/driver_cache.cpp deleted file mode 100644 index 650e6f16..00000000 --- a/src/drivers/driver_cache.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "driver_cache.hpp" - -#include -#include - -#include "display.hpp" -#include "display_init.hpp" -#include "storage.hpp" -#include "touchwheel.hpp" - -namespace drivers { - -DriverCache::DriverCache() : gpios_(std::make_unique()) {} -DriverCache::~DriverCache() {} - -auto DriverCache::AcquireGpios() -> GpioExpander* { - return gpios_.get(); -} - -auto DriverCache::AcquireDac() -> std::shared_ptr { - return Acquire(dac_, [&]() -> AudioDac* { - return AudioDac::create(AcquireGpios()).value_or(nullptr); - }); -} - -auto DriverCache::AcquireDisplay() -> std::shared_ptr { - return Acquire(display_, [&]() -> Display* { - return Display::create(AcquireGpios(), displays::kST7735R); - }); -} - -auto DriverCache::AcquireStorage() -> std::shared_ptr { - return Acquire(storage_, [&]() -> SdStorage* { - return SdStorage::create(AcquireGpios()).value_or(nullptr); - }); -} - -auto DriverCache::AcquireTouchWheel() -> std::shared_ptr { - return Acquire(touchwheel_, - [&]() -> TouchWheel* { return new TouchWheel(); }); -} - -} // namespace drivers -- cgit v1.2.3