diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-08-30 16:48:10 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-08-30 16:48:10 +1000 |
| commit | 320fdeb9d8355d3c361d5c6d60de8afc64501af9 (patch) | |
| tree | f0d5a2ab82199c78ad6768c6b18ba1239a0b7ee4 /src/system_fsm/service_locator.cpp | |
| parent | 4247c9fe7d25c921fbfc73fc50e849c8780e7ad6 (diff) | |
| download | tangara-fw-320fdeb9d8355d3c361d5c6d60de8afc64501af9.tar.gz | |
Use a service locator instead of passing around subsets of drivers between FSMs
Diffstat (limited to 'src/system_fsm/service_locator.cpp')
| -rw-r--r-- | src/system_fsm/service_locator.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 <me@jacqueline.id.au> + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#include "service_locator.hpp" + +#include <memory> + +#include "nvs.hpp" +#include "touchwheel.hpp" + +namespace system_fsm { + +auto ServiceLocator::instance() -> ServiceLocator& { + static ServiceLocator sInstance{}; + return sInstance; +} + +} // namespace system_fsm |
