From b7b1af1c4c3c21f62bf9627d39a37924be541c16 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 17 Jul 2021 11:59:19 +0300 Subject: Replace app_timer with FreeRTOS timers --- src/components/timer/TimerController.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/components/timer/TimerController.h') diff --git a/src/components/timer/TimerController.h b/src/components/timer/TimerController.h index fa7bc90d..93d8afc6 100644 --- a/src/components/timer/TimerController.h +++ b/src/components/timer/TimerController.h @@ -1,37 +1,33 @@ #pragma once -#include -#include "app_timer.h" -#include "portmacro_cmsis.h" +#include +#include namespace Pinetime { namespace System { class SystemTask; } namespace Controllers { - + class TimerController { public: TimerController() = default; - - void Init(); - + + void Init(System::SystemTask* systemTask); + void StartTimer(uint32_t duration); - + void StopTimer(); - + uint32_t GetTimeRemaining(); - + bool IsRunning(); void OnTimerEnd(); - void Register(System::SystemTask* systemTask); - private: System::SystemTask* systemTask = nullptr; - TickType_t endTicks; - bool timerRunning = false; + TimerHandle_t timer; }; } -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2