diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/motor/MotorController.cpp | 4 | ||||
| -rw-r--r-- | src/components/motor/MotorController.h | 1 | ||||
| -rw-r--r-- | src/components/timer/Timer.cpp | 4 | ||||
| -rw-r--r-- | src/components/timer/Timer.h | 2 |
4 files changed, 11 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); } diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index 6dea6d1f..ab8c956e 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -15,6 +15,7 @@ namespace Pinetime { void RunForDuration(uint8_t motorDuration); void StartRinging(); void StopRinging(); + bool IsRinging(); private: static void Ring(TimerHandle_t xTimer); diff --git a/src/components/timer/Timer.cpp b/src/components/timer/Timer.cpp index 4784cdb2..3ccffc7c 100644 --- a/src/components/timer/Timer.cpp +++ b/src/components/timer/Timer.cpp @@ -41,3 +41,7 @@ void Timer::StopTimer() { bool Timer::IsRunning() { return (xTimerIsTimerActive(timer) == pdTRUE); } + +void Timer::ResetExpiredTime() { + triggered = false; +} diff --git a/src/components/timer/Timer.h b/src/components/timer/Timer.h index a99f6c4d..d43c7970 100644 --- a/src/components/timer/Timer.h +++ b/src/components/timer/Timer.h @@ -25,6 +25,8 @@ namespace Pinetime { bool IsRunning(); + void ResetExpiredTime(); + private: TimerHandle_t timer; TickType_t expiry; |
