aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/datetime/DateTimeController.h
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-06-06 15:56:03 +0200
committerJean-François Milants <jf@codingfield.com>2021-06-06 15:56:03 +0200
commit7f9cc51b050e1034b573e37484f7afe29c370d81 (patch)
treede5228132fb72e89bb5d999b74b40f4248d41022 /src/components/datetime/DateTimeController.h
parent79f0fcb07aa80eb70385223272e29f2ba5657bc8 (diff)
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.
Diffstat (limited to 'src/components/datetime/DateTimeController.h')
-rw-r--r--src/components/datetime/DateTimeController.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h
index d0ae727e..265d6e9d 100644
--- a/src/components/datetime/DateTimeController.h
+++ b/src/components/datetime/DateTimeController.h
@@ -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[];