blob: dbc986355e5dc06906c522eaf92d6965c5f76b30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#pragma once
#include <cstdint>
#include "app_timer.h"
#include "portmacro_cmsis.h"
namespace Pinetime {
namespace System {
class SystemTask;
}
namespace Controllers {
class TimerController {
public:
TimerController() = default;
void Init();
void StartTimer(uint32_t duration);
void StopTimer();
void StopAlerting();
int32_t GetSecondsRemaining();
bool IsOvertime() {
return overtime;
}
bool IsRunning() {
return timerRunning;
}
void OnTimerEnd();
void Register(System::SystemTask* systemTask);
private:
System::SystemTask* systemTask = nullptr;
TickType_t endTicks;
bool timerRunning = false;
bool overtime = false;
};
}
}
|