5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-01-05 23:48:31 -04:00

AP_OSD: Make per-cell voltage be shown to two decimal places again

This commit is contained in:
Michelle Rossouw 2023-09-27 14:23:32 +10:00 committed by Andrew Tridgell
parent dd7f65ec51
commit e59b7a5215

View File

@ -1376,10 +1376,18 @@ void AP_OSD_Screen::draw_bat_volt(uint8_t instance, VoltageType type, uint8_t x,
}
if (!show_remaining_pct) {
// Do not show battery percentage
if (type == VoltageType::RESTING_CELL || type == VoltageType::AVG_CELL) {
backend->write(x,y, v < blinkvolt, "%1.2f%c", (double)v, SYMBOL(SYM_VOLT));
} else {
backend->write(x,y, v < blinkvolt, "%2.1f%c", (double)v, SYMBOL(SYM_VOLT));
}
return;
}
if (type == VoltageType::RESTING_CELL || type == VoltageType::AVG_CELL) {
backend->write(x,y, v < blinkvolt, "%c%1.2f%c", SYMBOL(SYM_BATT_FULL) + p, (double)v, SYMBOL(SYM_VOLT));
} else {
backend->write(x,y, v < blinkvolt, "%c%2.1f%c", SYMBOL(SYM_BATT_FULL) + p, (double)v, SYMBOL(SYM_VOLT));
}
}
void AP_OSD_Screen::draw_bat_volt(uint8_t x, uint8_t y)