diff options
| author | Robin Howard <robin@rhoward.id.au> | 2023-11-07 15:46:07 +1100 |
|---|---|---|
| committer | Robin Howard <robin@rhoward.id.au> | 2023-11-07 16:31:55 +1100 |
| commit | 135185f12ba07dea8568b06c0a65a00a8af7deb7 (patch) | |
| tree | 19724b4caf02c6127766be4e9bfd33d006cfdd25 /src/system_fsm/system_fsm.cpp | |
| parent | 3abf599c4f8b04bed4ed67084588204f65a644d0 (diff) | |
| download | tangara-fw-135185f12ba07dea8568b06c0a65a00a8af7deb7.tar.gz | |
haptics: adds a wrapper for the DRV2605L haptic motor driver
... with facilities to trigger effects via the system fsm.
Diffstat (limited to 'src/system_fsm/system_fsm.cpp')
| -rw-r--r-- | src/system_fsm/system_fsm.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |
