Browse Source

AP_OSD_Screen: make BLH RPM fixed length

zr-v5.1
Michel Pastor 4 years ago committed by Andrew Tridgell
parent
commit
30029f59db
  1. 4
      libraries/AP_OSD/AP_OSD_Screen.cpp

4
libraries/AP_OSD/AP_OSD_Screen.cpp

@ -1641,7 +1641,9 @@ void AP_OSD_Screen::draw_blh_rpm(uint8_t x, uint8_t y) @@ -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)

Loading…
Cancel
Save