summaryrefslogtreecommitdiff
path: root/src/drivers/include/relative_wheel.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-08-30 16:48:10 +1000
committerjacqueline <me@jacqueline.id.au>2023-08-30 16:48:10 +1000
commit320fdeb9d8355d3c361d5c6d60de8afc64501af9 (patch)
treef0d5a2ab82199c78ad6768c6b18ba1239a0b7ee4 /src/drivers/include/relative_wheel.hpp
parent4247c9fe7d25c921fbfc73fc50e849c8780e7ad6 (diff)
downloadtangara-fw-320fdeb9d8355d3c361d5c6d60de8afc64501af9.tar.gz
Use a service locator instead of passing around subsets of drivers between FSMs
Diffstat (limited to 'src/drivers/include/relative_wheel.hpp')
-rw-r--r--src/drivers/include/relative_wheel.hpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/drivers/include/relative_wheel.hpp b/src/drivers/include/relative_wheel.hpp
index 5e801aba..b5532a4c 100644
--- a/src/drivers/include/relative_wheel.hpp
+++ b/src/drivers/include/relative_wheel.hpp
@@ -20,11 +20,7 @@ namespace drivers {
class RelativeWheel {
public:
- static auto Create(TouchWheel* touch) -> RelativeWheel* {
- return new RelativeWheel(touch);
- }
-
- explicit RelativeWheel(TouchWheel* touch);
+ explicit RelativeWheel(TouchWheel& touch);
auto Update() -> void;
auto SetEnabled(bool) -> void;
@@ -37,7 +33,7 @@ class RelativeWheel {
RelativeWheel& operator=(const RelativeWheel&) = delete;
private:
- TouchWheel* touch_;
+ TouchWheel& touch_;
bool is_enabled_;