diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2022-12-31 09:56:03 +0200 |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2023-03-02 13:38:31 +0200 |
| commit | fff0a00a4a251fafa1c195d9f92fdc07affe3ca2 (patch) | |
| tree | 4318b106d753512c6901a5f2e44b891a38a2750d /src/components | |
| parent | 3b084d74c3b3864a4ce666dce0285aaf43a48a29 (diff) | |
Revert "added low battery message"
This reverts PR https://github.com/InfiniTimeOrg/InfiniTime/pull/1352
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/battery/BatteryController.cpp | 10 | ||||
| -rw-r--r-- | src/components/battery/BatteryController.h | 7 |
2 files changed, 0 insertions, 17 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(); diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index b47b77cc..5a7394c4 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -18,10 +18,6 @@ namespace Pinetime { return percentRemaining; } - bool BatteryIsLow() const { - return percentRemaining <= lowBatteryThreshold; - } - uint16_t Voltage() const { return voltage; } @@ -43,7 +39,6 @@ namespace Pinetime { static constexpr nrf_saadc_input_t batteryVoltageAdcInput = NRF_SAADC_INPUT_AIN7; uint16_t voltage = 0; uint8_t percentRemaining = 0; - bool batteryLowNotified = false; bool isFull = false; bool isCharging = false; @@ -55,8 +50,6 @@ namespace Pinetime { void SaadcEventHandler(nrfx_saadc_evt_t const* p_event); static void AdcCallbackStatic(nrfx_saadc_evt_t const* event); - static constexpr uint8_t lowBatteryThreshold {15}; - bool isReading = false; Pinetime::System::SystemTask* systemTask = nullptr; |
