diff options
Diffstat (limited to 'src/components/timer/TimerController.h')
| -rw-r--r-- | src/components/timer/TimerController.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/components/timer/TimerController.h b/src/components/timer/TimerController.h index 93d8afc..c3bdc2a 100644 --- a/src/components/timer/TimerController.h +++ b/src/components/timer/TimerController.h @@ -2,6 +2,7 @@ #include <FreeRTOS.h> #include <timers.h> +#include <cstdint> namespace Pinetime { namespace System { @@ -13,21 +14,28 @@ namespace Pinetime { public: TimerController() = default; - void Init(System::SystemTask* systemTask); - void StartTimer(uint32_t duration); - void StopTimer(); - - uint32_t GetTimeRemaining(); - - bool IsRunning(); + void StopAlerting(); + int32_t GetSecondsRemaining(); + inline bool IsOvertime() { + return overtime; + } + inline bool IsRunning() { + return timerRunning; + } void OnTimerEnd(); + protected: + friend class Pinetime::System::SystemTask; + void Init(System::SystemTask* systemTask); + private: System::SystemTask* systemTask = nullptr; TimerHandle_t timer; + bool timerRunning = false; + bool overtime = false; }; } -} +}
\ No newline at end of file |
