Initialize SystemTask, DisplayApp and HeartRateTask as global static variable instead of variables on the heap. We don't need them on the heap as we know their size at build time, it'll reduce memory fragmentation and it'll make memory analysis easier.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user