summaryrefslogtreecommitdiff
path: root/src/components/heartrate/Ppg.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-06-06 13:56:03 (GMT)
committerJean-François Milants <jf@codingfield.com>2021-06-06 13:56:03 (GMT)
commit7f9cc51b050e1034b573e37484f7afe29c370d81 (patch)
treede5228132fb72e89bb5d999b74b40f4248d41022 /src/components/heartrate/Ppg.cpp
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/Ppg.cpp')
-rw-r--r--src/components/heartrate/Ppg.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/components/heartrate/Ppg.cpp b/src/components/heartrate/Ppg.cpp
index da0789e..fcba381 100644
--- a/src/components/heartrate/Ppg.cpp
+++ b/src/components/heartrate/Ppg.cpp
@@ -38,9 +38,8 @@ namespace {
}
}
-Ppg::Ppg(float spl)
- : offset {spl},
- hpf {0.87033078, -1.74066156, 0.87033078, -1.72377617, 0.75754694},
+Ppg::Ppg()
+ : hpf {0.87033078, -1.74066156, 0.87033078, -1.72377617, 0.75754694},
agc {20, 0.971, 2},
lpf {0.11595249, 0.23190498, 0.11595249, -0.72168143, 0.18549138} {
}
@@ -67,13 +66,7 @@ float Ppg::HeartRate() {
dataIndex = 0;
return hr;
}
-
-int cccount = 0;
float Ppg::ProcessHeartRate() {
-
- if (cccount > 2)
- asm("nop");
- cccount++;
auto t0 = Trough(data.data(), dataIndex, 7, 48);
if (t0 < 0)
return 0;