Fix: Battery value show up on wrong screen.

Should not be seen on RDS & AF screen
This commit is contained in:
kevin
2023-08-03 22:45:10 +08:00
parent 118b7c7fac
commit 2b04c363b6
+2 -1
View File
@@ -5085,13 +5085,13 @@ void ShowBattery() {
batteryold = battery; batteryold = battery;
} }
if (!advancedRDS && !afscreen) {
if (batteryoptions > BATTERY_NONE) { if (batteryoptions > BATTERY_NONE) {
batteryV = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0); batteryV = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
if (batteryoptions == BATTERY_VALUE){ if (batteryoptions == BATTERY_VALUE){
if (batteryV < BATTERY_LOW_VALUE) return; if (batteryV < BATTERY_LOW_VALUE) return;
tftPrint(-1, String(batteryVold,1), 213, 163, BackgroundColor, BackgroundColor, FONT16); tftPrint(-1, String(batteryVold,1), 213, 163, BackgroundColor, BackgroundColor, FONT16);
tftPrint(-1, String(batteryV,1), 213, 163, PrimaryColor, PrimaryColorSmooth, FONT16); tftPrint(-1, String(batteryV,1), 213, 163, PrimaryColor, PrimaryColorSmooth, FONT16);
tftPrint(-1, "V", 232, 163, PrimaryColor, PrimaryColorSmooth, FONT16); tftPrint(-1, "V", 232, 163, PrimaryColor, PrimaryColorSmooth, FONT16);
batteryVold = batteryV; batteryVold = batteryV;
@@ -5109,6 +5109,7 @@ void ShowBattery() {
} }
} }
} }
}
void Communication() { void Communication() {
if (menu == false) { if (menu == false) {