From 99ae2f368bd3f9ca5521d2d04a426addbb00b04b Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Sun, 9 Nov 2025 18:17:51 +0000 Subject: Refactor Timer component to provide expiry information (#2365) --- src/components/timer/Timer.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/components/timer/Timer.h') 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 #include +#include 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 GetTimerState(); bool IsRunning(); private: TimerHandle_t timer; + TickType_t expiry; + bool triggered = false; }; } } -- cgit v1.2.3-70-g09d2