fixed a comment, set threshold to 15%
This commit is contained in:
parent
60027f217c
commit
51d818b774
|
@ -92,7 +92,7 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
|
||||||
percentRemaining = newPercent;
|
percentRemaining = newPercent;
|
||||||
systemTask->PushMessage(System::Messages::BatteryPercentageUpdated);
|
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) {
|
if (!isPowerPresent && BatteryIsLow() && lastPercentRemaining > lowBatteryThreshold) {
|
||||||
systemTask->PushMessage(System::Messages::LowBattery);
|
systemTask->PushMessage(System::Messages::LowBattery);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace Pinetime {
|
||||||
void SaadcEventHandler(nrfx_saadc_evt_t const* p_event);
|
void SaadcEventHandler(nrfx_saadc_evt_t const* p_event);
|
||||||
static void AdcCallbackStatic(nrfx_saadc_evt_t const* 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;
|
bool isReading = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue