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:
@@ -27,8 +27,6 @@ namespace Pinetime {
|
||||
December
|
||||
};
|
||||
|
||||
DateTime(System::SystemTask& systemTask);
|
||||
|
||||
void SetTime(uint16_t year,
|
||||
uint8_t month,
|
||||
uint8_t day,
|
||||
@@ -75,8 +73,9 @@ namespace Pinetime {
|
||||
return uptime;
|
||||
}
|
||||
|
||||
void Register(System::SystemTask* systemTask);
|
||||
|
||||
private:
|
||||
System::SystemTask& systemTask;
|
||||
uint16_t year = 0;
|
||||
Months month = Months::Unknown;
|
||||
uint8_t day = 0;
|
||||
@@ -90,6 +89,7 @@ namespace Pinetime {
|
||||
std::chrono::seconds uptime {0};
|
||||
|
||||
bool isMidnightAlreadyNotified = false;
|
||||
System::SystemTask* systemTask = nullptr;
|
||||
|
||||
static char const* DaysString[];
|
||||
static char const* DaysStringShort[];
|
||||
|
||||
Reference in New Issue
Block a user