aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/battery/BatteryController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/battery/BatteryController.cpp')
-rw-r--r--src/components/battery/BatteryController.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp
index 4d860490..d9e198c5 100644
--- a/src/components/battery/BatteryController.cpp
+++ b/src/components/battery/BatteryController.cpp
@@ -81,20 +81,10 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
newPercent = std::min(approx.GetValue(voltage), isCharging ? uint8_t {99} : uint8_t {100});
}
- if (isPowerPresent) {
- batteryLowNotified = false;
- }
-
if ((isPowerPresent && newPercent > percentRemaining) || (!isPowerPresent && newPercent < percentRemaining) || firstMeasurement) {
firstMeasurement = false;
percentRemaining = newPercent;
systemTask->PushMessage(System::Messages::BatteryPercentageUpdated);
-
- // warn about low battery when not charging and below threshold
- if (BatteryIsLow() && !isPowerPresent && !batteryLowNotified) {
- systemTask->PushMessage(System::Messages::LowBattery);
- batteryLowNotified = true;
- }
}
nrfx_saadc_uninit();