1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 01:35:35 +03:00

The battery icon changes depending on the percentage of remaining

voltage.
This commit is contained in:
raul-ortega 2017-04-12 22:28:25 +02:00
parent e738003dfe
commit 04baa22ba2

View file

@ -177,7 +177,9 @@ static void osdDrawSingleElement(uint8_t item)
case OSD_MAIN_BATT_VOLTAGE:
{
buff[0] = SYM_BATT_5;
uint8_t p = calculateBatteryPercentage();
p = (100-p)/16.6;
buff[0] = SYM_BATT_FULL + p;
sprintf(buff + 1, "%d.%1dV", vbat / 10, vbat % 10);
break;
}