update OnScreen Battery for AXP2101

This commit is contained in:
richonguzman 2024-09-19 09:37:15 -03:00
parent a0b391e0eb
commit ef6eb5bd29
1 changed files with 7 additions and 8 deletions

View File

@ -645,12 +645,11 @@ namespace MENU_Utils {
if (POWER_Utils::isCharging()) {
lowBatteryPercent = 21;
}
batteryVoltage = batteryVoltage.toFloat()/1000;
if (POWER_Utils::isCharging() && batteryCharge!="100") {
if (POWER_Utils::isCharging() && batteryCharge != "100") {
sixthRowMainMenu = "Bat: ";
sixthRowMainMenu += String(batteryVoltage);
sixthRowMainMenu += "V (charging)";
} else if (!POWER_Utils::isCharging() && batteryCharge=="100") {
} else if (!POWER_Utils::isCharging() && batteryCharge == "100") {
sixthRowMainMenu = "Battery Charged ";
sixthRowMainMenu += String(batteryVoltage);
sixthRowMainMenu += "V";
@ -666,11 +665,11 @@ namespace MENU_Utils {
sixthRowMainMenu = "No Battery Connected" ;
}
displayShow(firstRowMainMenu,
secondRowMainMenu,
thirdRowMainMenu,
fourthRowMainMenu,
fifthRowMainMenu,
sixthRowMainMenu);
secondRowMainMenu,
thirdRowMainMenu,
fourthRowMainMenu,
fifthRowMainMenu,
sixthRowMainMenu);
break;
}
}