mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Added altitude symbol in OSD.
This commit is contained in:
parent
915de9d6db
commit
bd03951ca4
3 changed files with 12 additions and 11 deletions
|
@ -33,6 +33,7 @@
|
|||
#define SYM_TEMPERATURE 0x7A
|
||||
#define SYM_LAT 0x89
|
||||
#define SYM_LON 0x98
|
||||
#define SYM_ALTITUDE 0x7F
|
||||
|
||||
// RSSI
|
||||
#define SYM_RSSI 0x01
|
||||
|
@ -119,7 +120,7 @@
|
|||
#define SYM_BATT_1 0x95
|
||||
#define SYM_BATT_EMPTY 0x96
|
||||
|
||||
// Batt Icon´s
|
||||
// Batt Icons
|
||||
#define SYM_MAIN_BATT 0x97
|
||||
|
||||
// Voltage and amperage
|
||||
|
|
|
@ -210,9 +210,9 @@ static void osdFormatAltitudeString(char * buff, int32_t altitudeCm)
|
|||
{
|
||||
const int alt = osdGetMetersToSelectedUnit(altitudeCm) / 10;
|
||||
|
||||
tfp_sprintf(buff, "%5d %c", alt, osdGetMetersToSelectedUnitSymbol());
|
||||
buff[5] = buff[4];
|
||||
buff[4] = '.';
|
||||
tfp_sprintf(buff, "%c%5d %c", SYM_ALTITUDE, alt, osdGetMetersToSelectedUnitSymbol());
|
||||
buff[6] = buff[5];
|
||||
buff[5] = '.';
|
||||
}
|
||||
|
||||
#ifdef USE_GPS
|
||||
|
|
|
@ -520,7 +520,7 @@ TEST(OsdTest, TestAlarms)
|
|||
displayPortTestBufferSubstring(12, 1, "%c16.8%c", SYM_BATT_FULL, SYM_VOLT);
|
||||
displayPortTestBufferSubstring(1, 1, "%c00:", SYM_FLY_M); // only test the minute part of the timer
|
||||
displayPortTestBufferSubstring(20, 1, "%c01:", SYM_ON_M); // only test the minute part of the timer
|
||||
displayPortTestBufferSubstring(23, 7, " .0%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c .0%c", SYM_ALTITUDE, SYM_M);
|
||||
}
|
||||
|
||||
// when
|
||||
|
@ -549,7 +549,7 @@ TEST(OsdTest, TestAlarms)
|
|||
displayPortTestBufferSubstring(12, 1, "%c13.5%c", SYM_MAIN_BATT, SYM_VOLT);
|
||||
displayPortTestBufferSubstring(1, 1, "%c01:", SYM_FLY_M); // only test the minute part of the timer
|
||||
displayPortTestBufferSubstring(20, 1, "%c02:", SYM_ON_M); // only test the minute part of the timer
|
||||
displayPortTestBufferSubstring(23, 7, " 120.0%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c 120.0%c", SYM_ALTITUDE, SYM_M);
|
||||
} else {
|
||||
displayPortTestBufferIsEmpty();
|
||||
}
|
||||
|
@ -770,7 +770,7 @@ TEST(OsdTest, TestElementAltitude)
|
|||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(23, 7, " .0%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c .0%c", SYM_ALTITUDE, SYM_M);
|
||||
|
||||
// when
|
||||
simulationAltitude = 247;
|
||||
|
@ -778,7 +778,7 @@ TEST(OsdTest, TestElementAltitude)
|
|||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(23, 7, " 2.4%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c 2.4%c", SYM_ALTITUDE, SYM_M);
|
||||
|
||||
// when
|
||||
simulationAltitude = 4247;
|
||||
|
@ -786,7 +786,7 @@ TEST(OsdTest, TestElementAltitude)
|
|||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(23, 7, " 42.4%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c 42.4%c", SYM_ALTITUDE, SYM_M);
|
||||
|
||||
// when
|
||||
simulationAltitude = -247;
|
||||
|
@ -794,7 +794,7 @@ TEST(OsdTest, TestElementAltitude)
|
|||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(23, 7, " -2.4%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c -2.4%c", SYM_ALTITUDE, SYM_M);
|
||||
|
||||
// when
|
||||
simulationAltitude = -70;
|
||||
|
@ -802,7 +802,7 @@ TEST(OsdTest, TestElementAltitude)
|
|||
osdRefresh(simulationTime);
|
||||
|
||||
// then
|
||||
displayPortTestBufferSubstring(23, 7, " -.7%c", SYM_M);
|
||||
displayPortTestBufferSubstring(23, 7, "%c -.7%c", SYM_ALTITUDE, SYM_M);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue