summaryrefslogtreecommitdiff
path: root/src/components/battery/BatteryController.h
diff options
context:
space:
mode:
authorJF <JF002@users.noreply.github.com>2021-10-03 16:13:39 +0200
committerGitHub <noreply@github.com>2021-10-03 16:13:39 +0200
commitfa6c291d3ef9358af9754782ffb4fe6c0f6916dd (patch)
treec5bbcdcd592c04af08b914de5ff9142d08a356ee /src/components/battery/BatteryController.h
parent3442085a3c03fcc0975d1c8c46a838bc18ae5574 (diff)
parent980ac173888883b34367395fdf8ee76c0aea6f72 (diff)
Merge pull request #638 from Riksu9000/detect_full_charge
Detect full charge and improve watchface battery display
Diffstat (limited to 'src/components/battery/BatteryController.h')
-rw-r--r--src/components/battery/BatteryController.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h
index 8af27ea8..c78ffb3f 100644
--- a/src/components/battery/BatteryController.h
+++ b/src/components/battery/BatteryController.h
@@ -22,7 +22,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,6 +39,7 @@ namespace Pinetime {
uint16_t voltage = 0;
uint8_t percentRemaining = 0;
+ bool isFull = false;
bool isCharging = false;
bool isPowerPresent = false;