diff options
Diffstat (limited to 'src/components/timer/TimerController.cpp')
| -rw-r--r-- | src/components/timer/TimerController.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/components/timer/TimerController.cpp b/src/components/timer/TimerController.cpp index 5e7f1eed..e3aa07af 100644 --- a/src/components/timer/TimerController.cpp +++ b/src/components/timer/TimerController.cpp @@ -1,16 +1,9 @@ #include "components/timer/TimerController.h" -#include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; -void TimerCallback(TimerHandle_t xTimer) { - auto* controller = static_cast<TimerController*>(pvTimerGetTimerID(xTimer)); - controller->OnTimerEnd(); -} - -void TimerController::Init(Pinetime::System::SystemTask* systemTask) { - this->systemTask = systemTask; - timer = xTimerCreate("Timer", 1, pdFALSE, this, TimerCallback); +TimerController::TimerController(void* const timerData, TimerCallbackFunction_t timerCallbackFunction) { + timer = xTimerCreate("Timer", 1, pdFALSE, timerData, timerCallbackFunction); } void TimerController::StartTimer(std::chrono::milliseconds duration) { @@ -33,7 +26,3 @@ void TimerController::StopTimer() { bool TimerController::IsRunning() { return (xTimerIsTimerActive(timer) == pdTRUE); } - -void TimerController::OnTimerEnd() { - systemTask->PushMessage(System::Messages::OnTimerDone); -} |
