diff options
author | Riku Isokoski <riksu9000@gmail.com> | 2021-09-22 13:58:45 +0300 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2021-09-22 13:58:45 +0300 |
commit | 980ac173888883b34367395fdf8ee76c0aea6f72 (patch) | |
tree | 535086de0864bff7d182efcb1cb275a6437ab2cf /src/components/battery/BatteryController.cpp | |
parent | b2100908373f76660fcfb5f3c454eb69a38ca4ef (diff) |
Show plug icon while plugged in
Diffstat (limited to 'src/components/battery/BatteryController.cpp')
-rw-r--r-- | src/components/battery/BatteryController.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp index d2ddae74..b43b229f 100644 --- a/src/components/battery/BatteryController.cpp +++ b/src/components/battery/BatteryController.cpp @@ -74,7 +74,7 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) { } else if (voltage < battery_min) { percentRemaining = 0; } else { - percentRemaining = std::min((voltage - battery_min) * 100 / (battery_max - battery_min), 99); + percentRemaining = std::min((voltage - battery_min) * 100 / (battery_max - battery_min), isCharging ? 99 : 100); } nrfx_saadc_uninit(); |