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/service_locator.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/system_fsm/service_locator.cpp (limited to 'src/system_fsm/service_locator.cpp') diff --git a/src/system_fsm/service_locator.cpp b/src/system_fsm/service_locator.cpp new file mode 100644 index 00000000..1d4d8a65 --- /dev/null +++ b/src/system_fsm/service_locator.cpp @@ -0,0 +1,21 @@ +/* + * Copyright 2023 jacqueline + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#include "service_locator.hpp" + +#include + +#include "nvs.hpp" +#include "touchwheel.hpp" + +namespace system_fsm { + +auto ServiceLocator::instance() -> ServiceLocator& { + static ServiceLocator sInstance{}; + return sInstance; +} + +} // namespace system_fsm -- cgit v1.2.3