mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Show only 3 significant digits in vbat OSD element
This commit is contained in:
parent
9d027275e2
commit
5d30b3f437
2 changed files with 10 additions and 4 deletions
|
@ -846,8 +846,14 @@ static void osdElementMainBatteryUsage(osdElementParms_t *element)
|
|||
|
||||
static void osdElementMainBatteryVoltage(osdElementParms_t *element)
|
||||
{
|
||||
const int batteryVoltage = (getBatteryVoltage() + 5) / 10;
|
||||
|
||||
element->buff[0] = osdGetBatterySymbol(getBatteryAverageCellVoltage());
|
||||
tfp_sprintf(element->buff + 1, "%2d.%02d%c", getBatteryVoltage() / 100, getBatteryVoltage() % 100, SYM_VOLT);
|
||||
if (batteryVoltage >= 100) {
|
||||
tfp_sprintf(element->buff + 1, "%d.%d%c", batteryVoltage / 10, batteryVoltage % 10, SYM_VOLT);
|
||||
} else {
|
||||
tfp_sprintf(element->buff + 1, "%d.%d0%c", batteryVoltage / 10, batteryVoltage % 10, SYM_VOLT);
|
||||
}
|
||||
}
|
||||
|
||||
static void osdElementMotorDiagnostics(osdElementParms_t *element)
|
||||
|
@ -1440,7 +1446,7 @@ void osdAnalyzeActiveElements(void)
|
|||
osdAddActiveElement(OSD_FLIGHT_DIST);
|
||||
}
|
||||
#endif // GPS
|
||||
#ifdef USE_ESC_SENSOR
|
||||
#ifdef USE_ESC_SENSOR
|
||||
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
|
||||
osdAddActiveElement(OSD_ESC_TMP);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue