Show plug at >=95% instead of exactly 100%

Boards without a charge-complete signal only infer "full" from voltage, and
a real pack rarely reads the full BATT_MAX_MILLIVOLTS (4.2V), so the plug icon
was effectively never shown. Treat "full" as a high band (>= 95%) so the plug
appears when the battery is charged rather than requiring an exact 100%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hansimgamr
2026-08-19 12:44:41 -04:00
co-authored by Claude Opus 4.8
parent 3a440ac41a
commit 41c60da575
+4 -1
View File
@@ -150,7 +150,10 @@ class HomeScreen : public UIScreen {
// keeping the fill bar itself clean and uninterrupted
bool charging = board.isExternalPowered();
if (charging) {
const uint8_t* symbol = (batteryPercentage < 100) ? charging_icon : plug_icon;
// There's no charge-complete signal on most boards, so "full" is a high
// voltage band rather than an exact 100% (a real pack rarely reads 4.2V).
const int BATT_FULL_PCT = 95;
const uint8_t* symbol = (batteryPercentage >= BATT_FULL_PCT) ? plug_icon : charging_icon;
display.setColor(UIColor::title_txt);
display.drawXbm(iconX - 9, iconY + 1, symbol, 8, 8);
}