diff options
Diffstat (limited to 'src/components/timer/Timer.h')
| -rw-r--r-- | src/components/timer/Timer.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/timer/Timer.h b/src/components/timer/Timer.h new file mode 100644 index 00000000..2469666f --- /dev/null +++ b/src/components/timer/Timer.h @@ -0,0 +1,26 @@ +#pragma once + +#include <FreeRTOS.h> +#include <timers.h> + +#include <chrono> + +namespace Pinetime { + namespace Controllers { + class Timer { + public: + Timer(void* timerData, TimerCallbackFunction_t timerCallbackFunction); + + void StartTimer(std::chrono::milliseconds duration); + + void StopTimer(); + + std::chrono::milliseconds GetTimeRemaining(); + + bool IsRunning(); + + private: + TimerHandle_t timer; + }; + } +} |
