Author: minacode <minamoto9@web.de>
fixed a comment, set threshold to 15%
src/components/battery/BatteryController.cpp | 2 +- src/components/battery/BatteryController.h | 2 +-
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp index a64ea0769c852a868c09b173e63102d2fafdf602..79829360449b4b76386daffcfe13996f2b1baac1 100644 --- a/src/components/battery/BatteryController.cpp +++ b/src/components/battery/BatteryController.cpp @@ -92,7 +92,7 @@ lastPercentRemaining = percentRemaining; percentRemaining = newPercent; systemTask->PushMessage(System::Messages::BatteryPercentageUpdated); - // warn at 20% battery (wrt. rescaling above) + // warn about low battery when not charging and below threshold if (!isPowerPresent && BatteryIsLow() && lastPercentRemaining > lowBatteryThreshold) { systemTask->PushMessage(System::Messages::LowBattery); } diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index df592232e9a21557a4b8db91ee5dd0538aed6985..3a7d73cee4415b76f2b7a7a6d3e5d261434a9dc3 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -54,7 +54,7 @@ void SaadcEventHandler(nrfx_saadc_evt_t const* p_event); static void AdcCallbackStatic(nrfx_saadc_evt_t const* event); - static constexpr uint8_t lowBatteryThreshold {20}; + static constexpr uint8_t lowBatteryThreshold {15}; bool isReading = false;