mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Add units symbol to the vario OSD element
This commit is contained in:
parent
ee564432f6
commit
ef74357faf
2 changed files with 13 additions and 1 deletions
|
@ -425,6 +425,16 @@ char osdGetSpeedToSelectedUnitSymbol(void)
|
|||
}
|
||||
}
|
||||
|
||||
char osdGetVarioToSelectedUnitSymbol(void)
|
||||
{
|
||||
switch (osdConfig()->units) {
|
||||
case OSD_UNIT_IMPERIAL:
|
||||
return SYM_FTPS;
|
||||
default:
|
||||
return SYM_MPS;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_ADC_INTERNAL) || defined(USE_ESC_SENSOR)
|
||||
char osdGetTemperatureSymbolForSelectedUnit(void)
|
||||
{
|
||||
|
@ -937,7 +947,7 @@ static void osdElementNumericalVario(osdElementParms_t *element)
|
|||
if (haveBaro || haveGps) {
|
||||
const int verticalSpeed = osdGetMetersToSelectedUnit(getEstimatedVario());
|
||||
const char directionSymbol = verticalSpeed < 0 ? SYM_ARROW_SOUTH : SYM_ARROW_NORTH;
|
||||
tfp_sprintf(element->buff, "%c%01d.%01d", directionSymbol, abs(verticalSpeed / 100), abs((verticalSpeed % 100) / 10));
|
||||
tfp_sprintf(element->buff, "%c%01d.%01d%c", directionSymbol, abs(verticalSpeed / 100), abs((verticalSpeed % 100) / 10), osdGetVarioToSelectedUnitSymbol());
|
||||
} else {
|
||||
// We use this symbol when we don't have a valid measure
|
||||
element->buff[0] = SYM_COLON;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue