diff options
Diffstat (limited to 'src/components/battery/BatteryController.h')
-rw-r--r-- | src/components/battery/BatteryController.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index 8af27ea8..5a7394c4 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -10,7 +10,8 @@ namespace Pinetime { public: Battery(); - void Update(); + void ReadPowerState(); + void MeasureVoltage(); void Register(System::SystemTask* systemTask); uint8_t PercentRemaining() const { @@ -22,7 +23,9 @@ namespace Pinetime { } bool IsCharging() const { - return isCharging; + // isCharging will go up and down when fully charged + // isFull makes sure this returns false while fully charged. + return isCharging && !isFull; } bool IsPowerPresent() const { @@ -37,8 +40,10 @@ namespace Pinetime { uint16_t voltage = 0; uint8_t percentRemaining = 0; + bool isFull = false; bool isCharging = false; bool isPowerPresent = false; + bool firstMeasurement = true; void SaadcInit(); |