1
0
Fork 0
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:
mikeller 2019-05-05 21:58:43 +12:00
parent 915de9d6db
commit bd03951ca4
3 changed files with 12 additions and 11 deletions

View file

@ -33,6 +33,7 @@
#define SYM_TEMPERATURE 0x7A #define SYM_TEMPERATURE 0x7A
#define SYM_LAT 0x89 #define SYM_LAT 0x89
#define SYM_LON 0x98 #define SYM_LON 0x98
#define SYM_ALTITUDE 0x7F
// RSSI // RSSI
#define SYM_RSSI 0x01 #define SYM_RSSI 0x01
@ -119,7 +120,7 @@
#define SYM_BATT_1 0x95 #define SYM_BATT_1 0x95
#define SYM_BATT_EMPTY 0x96 #define SYM_BATT_EMPTY 0x96
// Batt Icon´s // Batt Icons
#define SYM_MAIN_BATT 0x97 #define SYM_MAIN_BATT 0x97
// Voltage and amperage // Voltage and amperage

View file

@ -210,9 +210,9 @@ static void osdFormatAltitudeString(char * buff, int32_t altitudeCm)
{ {
const int alt = osdGetMetersToSelectedUnit(altitudeCm) / 10; const int alt = osdGetMetersToSelectedUnit(altitudeCm) / 10;
tfp_sprintf(buff, "%5d %c", alt, osdGetMetersToSelectedUnitSymbol()); tfp_sprintf(buff, "%c%5d %c", SYM_ALTITUDE, alt, osdGetMetersToSelectedUnitSymbol());
buff[5] = buff[4]; buff[6] = buff[5];
buff[4] = '.'; buff[5] = '.';
} }
#ifdef USE_GPS #ifdef USE_GPS

View file

@ -520,7 +520,7 @@ TEST(OsdTest, TestAlarms)
displayPortTestBufferSubstring(12, 1, "%c16.8%c", SYM_BATT_FULL, SYM_VOLT); 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(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(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 // when
@ -549,7 +549,7 @@ TEST(OsdTest, TestAlarms)
displayPortTestBufferSubstring(12, 1, "%c13.5%c", SYM_MAIN_BATT, SYM_VOLT); 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(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(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 { } else {
displayPortTestBufferIsEmpty(); displayPortTestBufferIsEmpty();
} }
@ -770,7 +770,7 @@ TEST(OsdTest, TestElementAltitude)
osdRefresh(simulationTime); osdRefresh(simulationTime);
// then // then
displayPortTestBufferSubstring(23, 7, " .0%c", SYM_M); displayPortTestBufferSubstring(23, 7, "%c .0%c", SYM_ALTITUDE, SYM_M);
// when // when
simulationAltitude = 247; simulationAltitude = 247;
@ -778,7 +778,7 @@ TEST(OsdTest, TestElementAltitude)
osdRefresh(simulationTime); osdRefresh(simulationTime);
// then // then
displayPortTestBufferSubstring(23, 7, " 2.4%c", SYM_M); displayPortTestBufferSubstring(23, 7, "%c 2.4%c", SYM_ALTITUDE, SYM_M);
// when // when
simulationAltitude = 4247; simulationAltitude = 4247;
@ -786,7 +786,7 @@ TEST(OsdTest, TestElementAltitude)
osdRefresh(simulationTime); osdRefresh(simulationTime);
// then // then
displayPortTestBufferSubstring(23, 7, " 42.4%c", SYM_M); displayPortTestBufferSubstring(23, 7, "%c 42.4%c", SYM_ALTITUDE, SYM_M);
// when // when
simulationAltitude = -247; simulationAltitude = -247;
@ -794,7 +794,7 @@ TEST(OsdTest, TestElementAltitude)
osdRefresh(simulationTime); osdRefresh(simulationTime);
// then // then
displayPortTestBufferSubstring(23, 7, " -2.4%c", SYM_M); displayPortTestBufferSubstring(23, 7, "%c -2.4%c", SYM_ALTITUDE, SYM_M);
// when // when
simulationAltitude = -70; simulationAltitude = -70;
@ -802,7 +802,7 @@ TEST(OsdTest, TestElementAltitude)
osdRefresh(simulationTime); osdRefresh(simulationTime);
// then // then
displayPortTestBufferSubstring(23, 7, " -.7%c", SYM_M); displayPortTestBufferSubstring(23, 7, "%c -.7%c", SYM_ALTITUDE, SYM_M);
} }
/* /*