summaryrefslogtreecommitdiff
path: root/src/components/battery/BatteryController.cpp
diff options
context:
space:
mode:
authorJoaquim <joaquim.org@gmail.com>2021-04-08 15:15:57 (GMT)
committerJoaquim <joaquim.org@gmail.com>2021-04-08 15:15:57 (GMT)
commit3cf4df905a20a51939141430e155c9d8e6623e30 (patch)
treed297f74ff987e3dc6f53ebd4076dd8f896fc00fa /src/components/battery/BatteryController.cpp
parent365e68e6cc3c9f893e7582d26a1805d6d51ef294 (diff)
restore battery buffer
Diffstat (limited to 'src/components/battery/BatteryController.cpp')
-rw-r--r--src/components/battery/BatteryController.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp
index beca95c..4a7a234 100644
--- a/src/components/battery/BatteryController.cpp
+++ b/src/components/battery/BatteryController.cpp
@@ -66,6 +66,8 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const * p_event) {
percentRemaining = std::max(percentRemaining, 0);
percentRemaining = std::min(percentRemaining, 100);
+ percentRemainingBuffer.insert(percentRemaining);
+
nrfx_saadc_uninit();
}
}
@@ -73,11 +75,3 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const * p_event) {
void Battery::adcCallbackStatic(nrfx_saadc_evt_t const *event) {
instance->SaadcEventHandler(event);
}
-
-int Battery::PercentRemaining() {
- return percentRemaining;
-}
-
-float Battery::Voltage() {
- return voltage;
-} \ No newline at end of file