aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/battery/BatteryController.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2022-12-31 09:56:03 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-03-02 13:38:31 +0200
commitfff0a00a4a251fafa1c195d9f92fdc07affe3ca2 (patch)
tree4318b106d753512c6901a5f2e44b891a38a2750d /src/components/battery/BatteryController.cpp
parent3b084d74c3b3864a4ce666dce0285aaf43a48a29 (diff)
Revert "added low battery message"
This reverts PR https://github.com/InfiniTimeOrg/InfiniTime/pull/1352
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();