aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/heartrate/HeartRateController.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/heartrate/HeartRateController.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/heartrate/HeartRateController.h')
-rw-r--r--src/components/heartrate/HeartRateController.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/components/heartrate/HeartRateController.h b/src/components/heartrate/HeartRateController.h
index d3a8460d..a63f1a70 100644
--- a/src/components/heartrate/HeartRateController.h
+++ b/src/components/heartrate/HeartRateController.h
@@ -15,8 +15,7 @@ namespace Pinetime {
public:
enum class States { Stopped, NotEnoughData, NoTouch, Running };
- explicit HeartRateController(System::SystemTask& systemTask);
-
+ HeartRateController() = default;
void Start();
void Stop();
void Update(States newState, uint8_t heartRate);
@@ -32,7 +31,6 @@ namespace Pinetime {
void SetService(Pinetime::Controllers::HeartRateService* service);
private:
- System::SystemTask& systemTask;
Applications::HeartRateTask* task = nullptr;
States state = States::Stopped;
uint8_t heartRate = 0;