diff --git a/src/main/cli/settings.c b/src/main/cli/settings.c index c60e63f8d..91d3550ff 100644 --- a/src/main/cli/settings.c +++ b/src/main/cli/settings.c @@ -1130,7 +1130,6 @@ const clivalue_t valueTable[] = { // PG_OSD_CONFIG #ifdef USE_OSD { "osd_units", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_UNIT }, PG_OSD_CONFIG, offsetof(osdConfig_t, units) }, - { "osd_dynamic_distance_units", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_OSD_CONFIG, offsetof(osdConfig_t, dynamic_distance_units) }, // Please try to keep the OSD warnings in the same order as presented in the Configurator. // This makes it easier for the user to relate the CLI output as warnings are in the same relative diff --git a/src/main/drivers/max7456_symbols.h b/src/main/drivers/max7456_symbols.h index ea2df2a9a..fafa2d45a 100644 --- a/src/main/drivers/max7456_symbols.h +++ b/src/main/drivers/max7456_symbols.h @@ -48,12 +48,12 @@ // Unit Icons (Metric) #define SYM_M 0x0C -#define SYM_KM 0x4B // 'K' +#define SYM_KM 0x7D #define SYM_C 0x0E // Unit Icons (Imperial) #define SYM_FT 0x0F -#define SYM_MILES 0x4D // 'M' +#define SYM_MILES 0x7E #define SYM_F 0x0D // Heading Graphics diff --git a/src/main/osd/osd.c b/src/main/osd/osd.c index 4c9cb71d3..a4953067e 100644 --- a/src/main/osd/osd.c +++ b/src/main/osd/osd.c @@ -302,7 +302,6 @@ void pgResetFn_osdConfig(osdConfig_t *osdConfig) osdConfig->profile[i][0] = '\0'; } osdConfig->rssi_dbm_alarm = 60; - osdConfig->dynamic_distance_units = true; } static void osdDrawLogo(int x, int y) @@ -710,9 +709,9 @@ static bool osdDisplayStat(int statistic, uint8_t displayRow) #define METERS_PER_KILOMETER 1000 #define METERS_PER_MILE 1609 if (osdConfig()->units == OSD_UNIT_IMPERIAL) { - tfp_sprintf(buff, "%dMI", statsConfig()->stats_total_dist_m / METERS_PER_MILE); + tfp_sprintf(buff, "%d%c", statsConfig()->stats_total_dist_m / METERS_PER_MILE, SYM_MILES); } else { - tfp_sprintf(buff, "%dKM", statsConfig()->stats_total_dist_m / METERS_PER_KILOMETER); + tfp_sprintf(buff, "%d%c", statsConfig()->stats_total_dist_m / METERS_PER_KILOMETER, SYM_KM); } osdDisplayStatisticLabel(displayRow, "TOTAL DISTANCE", buff); return true; diff --git a/src/main/osd/osd.h b/src/main/osd/osd.h index 33d83627c..c8e5cc43c 100644 --- a/src/main/osd/osd.h +++ b/src/main/osd/osd.h @@ -257,7 +257,6 @@ typedef struct osdConfig_s { char profile[OSD_PROFILE_COUNT][OSD_PROFILE_NAME_LENGTH + 1]; uint16_t link_quality_alarm; uint8_t rssi_dbm_alarm; - uint8_t dynamic_distance_units; // Whether to change from meters to km or ft to miles automatically } osdConfig_t; PG_DECLARE(osdConfig_t, osdConfig); diff --git a/src/main/osd/osd_elements.c b/src/main/osd/osd_elements.c index 133ec5fc6..2ccd849db 100644 --- a/src/main/osd/osd_elements.c +++ b/src/main/osd/osd_elements.c @@ -263,7 +263,7 @@ void osdFormatDistanceString(char *ptr, int distance, char leadingSymbol) break; } - if (convertedDistance < unitTransition || !osdConfig()->dynamic_distance_units) { + if (convertedDistance < unitTransition) { tfp_sprintf(ptr, "%d%c", convertedDistance, unitSymbol); } else { const int displayDistance = convertedDistance * 100 / unitTransition; diff --git a/src/test/unit/osd_unittest.cc b/src/test/unit/osd_unittest.cc index a10e43b57..831093c71 100644 --- a/src/test/unit/osd_unittest.cc +++ b/src/test/unit/osd_unittest.cc @@ -328,7 +328,6 @@ TEST(OsdTest, TestStatsImperial) // and // using imperial unit system osdConfigMutable()->units = OSD_UNIT_IMPERIAL; - osdConfigMutable()->dynamic_distance_units = false; // and // this timer 1 configuration @@ -415,7 +414,6 @@ TEST(OsdTest, TestStatsMetric) // given // using metric unit system osdConfigMutable()->units = OSD_UNIT_METRIC; - osdConfigMutable()->dynamic_distance_units = false; // set timer 1 configuration to tenths precision osdConfigMutable()->timers[OSD_TIMER_1] = OSD_TIMER(OSD_TIMER_SRC_TOTAL_ARMED, OSD_TIMER_PREC_TENTHS, 0); @@ -472,7 +470,6 @@ TEST(OsdTest, TestStatsMetricDistanceUnits) // given // using metric unit system osdConfigMutable()->units = OSD_UNIT_METRIC; - osdConfigMutable()->dynamic_distance_units = true; // set timer 1 configuration to tenths precision osdConfigMutable()->timers[OSD_TIMER_1] = OSD_TIMER(OSD_TIMER_SRC_TOTAL_ARMED, OSD_TIMER_PREC_TENTHS, 0);