[Taranis] Bug on voltage gauge when voltage < mininimum of the gauge
This commit is contained in:
+4
-4
@@ -217,12 +217,12 @@ void displaySliders()
|
||||
#define BAR_VOLUME_X BAR_X+147
|
||||
#define BAR_TIME_X BAR_X+168
|
||||
|
||||
void displayTopBarGauge(xcoord_t x, uint8_t count, bool blinking=false)
|
||||
void displayTopBarGauge(xcoord_t x, int count, bool blinking=false)
|
||||
{
|
||||
if (!blinking || BLINK_ON_PHASE)
|
||||
lcd_filled_rect(x+1, BAR_Y+2, 11, 5, SOLID, ERASE);
|
||||
count = min((uint8_t)10, count);
|
||||
for (uint8_t i=0; i<count; i+=2)
|
||||
count = min(10, count);
|
||||
for (int i=0; i<count; i+=2)
|
||||
lcd_vline(x+2+i, BAR_Y+3, 3);
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ void displayTopBar()
|
||||
lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND);
|
||||
|
||||
/* The inside of the Batt gauge */
|
||||
uint8_t count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin);
|
||||
int count = 10 * (g_vbat100mV - g_eeGeneral.vBatMin - 90) / (30 + g_eeGeneral.vBatMax - g_eeGeneral.vBatMin);
|
||||
displayTopBarGauge(BAR_BATT_X+FW, count, g_vbat100mV <= g_eeGeneral.vBatWarn);
|
||||
|
||||
/* The inside of the RSSI gauge */
|
||||
|
||||
Reference in New Issue
Block a user