summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaldor Takacs <g@ldor.de>2022-09-01 22:30:29 +0200
committerJF <JF002@users.noreply.github.com>2022-10-02 15:58:17 +0200
commit1439dfd912c284aaed35eed7d211d34d3aaec4fa (patch)
tree009c7528d8ea7c404d31cd87804c15ec6f9af936
parent60abbf0639d14334a27569da7cec71c447a2ab92 (diff)
motorController: Fix infinite vibration on RunForDuration(0)
-rw-r--r--src/components/motor/MotorController.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp
index 90e41d20..db6103f4 100644
--- a/src/components/motor/MotorController.cpp
+++ b/src/components/motor/MotorController.cpp
@@ -19,7 +19,7 @@ void MotorController::Ring(TimerHandle_t xTimer) {
}
void MotorController::RunForDuration(uint8_t motorDuration) {
- if (xTimerChangePeriod(shortVib, pdMS_TO_TICKS(motorDuration), 0) == pdPASS && xTimerStart(shortVib, 0) == pdPASS) {
+ if (motorDuration > 0 && xTimerChangePeriod(shortVib, pdMS_TO_TICKS(motorDuration), 0) == pdPASS && xTimerStart(shortVib, 0) == pdPASS) {
nrf_gpio_pin_clear(PinMap::Motor);
}
}