aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/motor/MotorController.cpp
diff options
context:
space:
mode:
authorVictor Kareh <vkareh@redhat.com>2024-01-08 10:02:45 -0500
committerJF <JF002@users.noreply.github.com>2025-12-13 21:31:50 +0100
commit54f20ff4cb439f9997adb0e295caeb3130bfaecc (patch)
tree21ab627797bfc9d98a6e143d4e4d1195d6d52460 /src/components/motor/MotorController.cpp
parent7128fc045db083c7014166872b50b536942c06e0 (diff)
timer: Add ringing and counter
The timer app issues a short buzz once and then disappears. There is no trace left that the timer finished or how long ago. This change makes the motor start ringing and presents a timer counter. The timer stops buzzing after 10 seconds, and finally resets after 1 minute.
Diffstat (limited to 'src/components/motor/MotorController.cpp')
-rw-r--r--src/components/motor/MotorController.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp
index 4e392416..d3bd2cf3 100644
--- a/src/components/motor/MotorController.cpp
+++ b/src/components/motor/MotorController.cpp
@@ -34,6 +34,10 @@ void MotorController::StopRinging() {
nrf_gpio_pin_set(PinMap::Motor);
}
+bool MotorController::IsRinging() {
+ return (xTimerIsTimerActive(longVib) == pdTRUE);
+}
+
void MotorController::StopMotor(TimerHandle_t /*xTimer*/) {
nrf_gpio_pin_set(PinMap::Motor);
}