diff options
author | JF002 <JF002@users.noreply.github.com> | 2021-06-12 11:02:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-12 11:02:06 +0200 |
commit | 0ce98c7ac7ba66acaf504be9bb042796e12f2733 (patch) | |
tree | 3f9c7f96f0fab64f581035c72480596a4cc4db43 /src/components/timer/TimerController.h | |
parent | 79f0fcb07aa80eb70385223272e29f2ba5657bc8 (diff) | |
parent | 6d524ebea2c97e309633d5e01c3a1e37c182f27d (diff) |
Merge pull request #415 from JF002/move-heap-to-static
Move dynamically allocated variables to static variables.
Diffstat (limited to 'src/components/timer/TimerController.h')
-rw-r--r-- | src/components/timer/TimerController.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/components/timer/TimerController.h b/src/components/timer/TimerController.h index 5a0b293e..fa7bc90d 100644 --- a/src/components/timer/TimerController.h +++ b/src/components/timer/TimerController.h @@ -12,7 +12,7 @@ namespace Pinetime { class TimerController { public: - TimerController(Pinetime::System::SystemTask& systemTask); + TimerController() = default; void Init(); @@ -23,12 +23,13 @@ namespace Pinetime { uint32_t GetTimeRemaining(); bool IsRunning(); - + + void OnTimerEnd(); + + void Register(System::SystemTask* systemTask); + private: - System::SystemTask& systemTask; - - static void timerEnd(void* p_context); - + System::SystemTask* systemTask = nullptr; TickType_t endTicks; bool timerRunning = false; }; |