fixed a comment, set threshold to 15%

This commit is contained in:
minacode 2022-11-20 13:16:28 +01:00 committed by JF
parent 60027f217c
commit 51d818b774
2 changed files with 2 additions and 2 deletions

View file

@ -92,7 +92,7 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
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);
}

View file

@ -54,7 +54,7 @@ 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 {20};
static constexpr uint8_t lowBatteryThreshold {15};
bool isReading = false;