From 135185f12ba07dea8568b06c0a65a00a8af7deb7 Mon Sep 17 00:00:00 2001 From: Robin Howard Date: Tue, 7 Nov 2023 15:46:07 +1100 Subject: haptics: adds a wrapper for the DRV2605L haptic motor driver ... with facilities to trigger effects via the system fsm. --- src/system_fsm/system_fsm.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/system_fsm/system_fsm.cpp') diff --git a/src/system_fsm/system_fsm.cpp b/src/system_fsm/system_fsm.cpp index 1e92cd62..31aec789 100644 --- a/src/system_fsm/system_fsm.cpp +++ b/src/system_fsm/system_fsm.cpp @@ -29,6 +29,11 @@ void SystemState::react(const FatalError& err) { } } +void SystemState::react(const HapticTrigger& trigger) { + auto& haptics = sServices->haptics(); + haptics.PlayWaveformEffect(trigger.effect); +} + void SystemState::react(const internal::GpioInterrupt&) { auto& gpios = sServices->gpios(); bool prev_key_lock = gpios.Get(drivers::Gpios::Pin::kKeyLock); -- cgit v1.2.3