AP_OSD_Screen: make BLH RPM fixed length

This commit is contained in:
Michel Pastor 2021-06-02 20:41:39 +02:00 committed by Andrew Tridgell
parent 31c345fc4b
commit 30029f59db

View File

@ -1641,7 +1641,9 @@ void AP_OSD_Screen::draw_blh_rpm(uint8_t x, uint8_t y)
if (!AP::esc_telem().get_rpm(0, rpm)) {
return;
}
backend->write(x, y, false, "%3.1f%c%c", uint16_t(rpm) * 0.001f, SYM_KILO, SYM_RPM);
float krpm = rpm * 0.001f;
const char *format = krpm < 9.995 ? "%.2f%c%c" : (krpm < 99.95 ? "%.1f%c%c" : "%.0f%c%c");
backend->write(x, y, false, format, krpm, SYM_KILO, SYM_RPM);
}
void AP_OSD_Screen::draw_blh_amps(uint8_t x, uint8_t y)