diff options
Diffstat (limited to 'src/components/timer/Timer.h')
| -rw-r--r-- | src/components/timer/Timer.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/timer/Timer.h b/src/components/timer/Timer.h index 2469666f..a99f6c4d 100644 --- a/src/components/timer/Timer.h +++ b/src/components/timer/Timer.h @@ -4,23 +4,31 @@ #include <timers.h> #include <chrono> +#include <optional> namespace Pinetime { namespace Controllers { class Timer { public: + struct TimerStatus { + std::chrono::milliseconds distanceToExpiry; + bool expired; + }; + Timer(void* timerData, TimerCallbackFunction_t timerCallbackFunction); void StartTimer(std::chrono::milliseconds duration); void StopTimer(); - std::chrono::milliseconds GetTimeRemaining(); + std::optional<TimerStatus> GetTimerState(); bool IsRunning(); private: TimerHandle_t timer; + TickType_t expiry; + bool triggered = false; }; } } |
