diff --git a/sim/components/battery/BatteryController.h b/sim/components/battery/BatteryController.h index d84af45..61d10f3 100644 --- a/sim/components/battery/BatteryController.h +++ b/sim/components/battery/BatteryController.h @@ -21,6 +21,10 @@ namespace Pinetime { return voltage; } + bool BatteryIsLow() const { + return percentRemaining <= lowBatteryThreshold; + } + bool IsCharging() const { // isCharging will go up and down when fully charged // isFull makes sure this returns false while fully charged. @@ -49,6 +53,8 @@ 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}; + bool isReading = false; Pinetime::System::SystemTask* systemTask = nullptr;