Bugfix in battery indicator
This commit is contained in:
+3
-8
@@ -2795,18 +2795,12 @@ void ShowBattery() {
|
|||||||
if (battery == 0) {
|
if (battery == 0) {
|
||||||
tft.drawRect(277, 6, 37, 20, BarSignificantColor);
|
tft.drawRect(277, 6, 37, 20, BarSignificantColor);
|
||||||
tft.fillRect(313, 13, 4, 6, BarSignificantColor);
|
tft.fillRect(313, 13, 4, 6, BarSignificantColor);
|
||||||
tft.fillRect(279, 8, 33, 16, BackgroundColor);
|
|
||||||
if (batteryoptions != BATTERY_VALUE || batteryoptions != BATTERY_PERCENT) {
|
|
||||||
tft.fillRect(279, 24 - (battery * 4), 33, battery * 4, BarInsignificantColor);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
tft.drawRect(277, 6, 37, 20, ActiveColor);
|
tft.drawRect(277, 6, 37, 20, ActiveColor);
|
||||||
tft.fillRect(313, 13, 4, 6, ActiveColor);
|
tft.fillRect(313, 13, 4, 6, ActiveColor);
|
||||||
|
}
|
||||||
tft.fillRect(279, 8, 33, 16, BackgroundColor);
|
tft.fillRect(279, 8, 33, 16, BackgroundColor);
|
||||||
if (batteryoptions != BATTERY_VALUE || batteryoptions != BATTERY_PERCENT) {
|
if (batteryoptions != BATTERY_VALUE && batteryoptions != BATTERY_PERCENT) tft.fillRect(279, 24 - (battery * 4), 33, battery * 4, BarInsignificantColor);
|
||||||
tft.fillRect(279, 24 - (battery * 4), 33, battery * 4, BarInsignificantColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
tft.drawRect(277, 6, 37, 20, GreyoutColor);
|
tft.drawRect(277, 6, 37, 20, GreyoutColor);
|
||||||
tft.fillRect(313, 13, 4, 6, GreyoutColor);
|
tft.fillRect(313, 13, 4, 6, GreyoutColor);
|
||||||
@@ -2825,6 +2819,7 @@ void ShowBattery() {
|
|||||||
tftReplace(-1, String(batteryVold, 1) + "V", String(batteryV, 1) + "V", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16);
|
tftReplace(-1, String(batteryVold, 1) + "V", String(batteryV, 1) + "V", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16);
|
||||||
batteryVold = batteryV;
|
batteryVold = batteryV;
|
||||||
} else if (int(vPer) != int(vPerold) && batteryoptions == BATTERY_PERCENT && abs(vPer - vPerold) > 0.5) {
|
} else if (int(vPer) != int(vPerold) && batteryoptions == BATTERY_PERCENT && abs(vPer - vPerold) > 0.5) {
|
||||||
|
if (vPer > 99.0) vPer = 99.0;
|
||||||
tftReplace(-1, String(vPerold, 0) + "%", String(vPer, 0) + "%", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16);
|
tftReplace(-1, String(vPerold, 0) + "%", String(vPer, 0) + "%", 279, 9, BatteryValueColor, BatteryValueColorSmooth, 16);
|
||||||
vPerold = vPer;
|
vPerold = vPer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user