diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2023-04-11 12:18:49 +0300 |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2023-04-16 14:33:23 +0000 |
| commit | 40f7e1c7be6882e01058b5ccf64d5005c6105346 (patch) | |
| tree | 7117de9dc371404da75efd10813d724b5e0205a3 /src/components/timer/Timer.h | |
| parent | 661ffbeb1eea68ec0cd63b4db537515f1d1772c8 (diff) | |
TimerController: Rename to Timer
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; + }; + } +} |
