Skip to content

Commit 81c0608

Browse files
author
minacode
committed
added threshold
1 parent 3381d68 commit 81c0608

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sim/components/battery/BatteryController.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Pinetime {
2222
}
2323

2424
bool BatteryIsLow() const {
25-
return false;
25+
return percentRemaining <= lowBatteryThreshold;
2626
}
2727

2828
bool IsCharging() const {
@@ -53,6 +53,8 @@ namespace Pinetime {
5353
//void SaadcEventHandler(nrfx_saadc_evt_t const* p_event);
5454
//static void AdcCallbackStatic(nrfx_saadc_evt_t const* event);
5555

56+
static constexpr uint8_t lowBatteryThreshold {20};
57+
5658
bool isReading = false;
5759

5860
Pinetime::System::SystemTask* systemTask = nullptr;

0 commit comments

Comments
 (0)