summaryrefslogtreecommitdiff
path: root/src/components/timer
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/timer')
-rw-r--r--src/components/timer/TimerController.cpp7
-rw-r--r--src/components/timer/TimerController.h6
2 files changed, 5 insertions, 8 deletions
diff --git a/src/components/timer/TimerController.cpp b/src/components/timer/TimerController.cpp
index 35e3512..fa00d3c 100644
--- a/src/components/timer/TimerController.cpp
+++ b/src/components/timer/TimerController.cpp
@@ -15,7 +15,8 @@ namespace {
}
}
-void TimerController::Init() {
+void Init(System::SystemTask* systemTask) {
+ this->systemTask = systemTask;
timerAppTimer = xTimerCreate("timerAppTm", 1, pdFALSE, this, TimerEnd);
}
@@ -59,7 +60,3 @@ void TimerController::OnTimerEnd() {
systemTask->PushMessage(System::Messages::OnTimerDone);
}
}
-
-void TimerController::Register(Pinetime::System::SystemTask* systemTask) {
- this->systemTask = systemTask;
-}
diff --git a/src/components/timer/TimerController.h b/src/components/timer/TimerController.h
index 8542987..cdd78ec 100644
--- a/src/components/timer/TimerController.h
+++ b/src/components/timer/TimerController.h
@@ -16,7 +16,6 @@ namespace Pinetime {
public:
TimerController() = default;
- void Init();
void StartTimer(uint32_t duration);
void StopTimer();
void StopAlerting();
@@ -29,8 +28,9 @@ namespace Pinetime {
}
void OnTimerEnd();
-
- void Register(System::SystemTask* systemTask);
+ protected:
+ friend class Pinetime::System::SystemTask;
+ void Init(System::SystemTask* systemTask);
private:
System::SystemTask* systemTask = nullptr;