From a024c8f90d872a5ae5be6802da6d89ab6f6a086a Mon Sep 17 00:00:00 2001 From: bkleiner Date: Sat, 24 Aug 2024 01:25:15 +0200 Subject: [PATCH] add osd profiles --- src/core/profile.c | 78 ++++++++++++++++++++++++------------------- src/core/profile.h | 31 +++++++++++++----- src/osd/menu.c | 2 -- src/osd/render.c | 82 ++++++++++++++++++++++++++++++---------------- src/osd/render.h | 32 +++++++----------- src/osd/status.c | 4 +-- src/rx/rx.h | 3 +- 7 files changed, 135 insertions(+), 97 deletions(-) diff --git a/src/core/profile.c b/src/core/profile.c index 26c6c0127..40ea1ce6b 100644 --- a/src/core/profile.c +++ b/src/core/profile.c @@ -406,7 +406,7 @@ const profile_t default_profile = { RACEMODE, // AUX_RACEMODE HORIZON, // AUX_HORIZON STICK_BOOST_PROFILE, // AUX_STICK_BOOST_PROFILE - AUX_CHANNEL_OFF, // AUX_RATE_PROFILE + AUX_CHANNEL_OFF, // UNUSED_AUX_HIGH_RATES #ifdef BUZZER_ENABLE // AUX_BUZZER_ENABLE BUZZER_ENABLE, #else @@ -427,6 +427,7 @@ const profile_t default_profile = { #endif AUX_CHANNEL_OFF, // AUX_BLACKBOX PREARM, // AUX_PREARM + AUX_CHANNEL_OFF, // AUX_OSD_PROFILE }, .lqi_source = RX_LQI_SOURCE_PACKET_RATE, .channel_mapping = RX_MAPPING_AETR, @@ -438,39 +439,48 @@ const profile_t default_profile = { }, }, .osd = { - .callsign = "QUICKSILVER", - .elements = { - ENCODE_OSD_ELEMENT(1, 1, 9, 1), // OSD_CALLSIGN - ENCODE_OSD_ELEMENT(1, 0, 11, 14), // OSD_CELL_COUNT - ENCODE_OSD_ELEMENT(0, 0, 1, 14), // OSD_FUELGAUGE_VOLTS - ENCODE_OSD_ELEMENT(1, 0, 14, 14), // OSD_FILTERED_VOLTS - ENCODE_OSD_ELEMENT(1, 0, 24, 14), // OSD_GYRO_TEMP - ENCODE_OSD_ELEMENT(1, 0, 10, 13), // OSD_FLIGHT_MODE - ENCODE_OSD_ELEMENT(1, 0, 24, 1), // OSD_RSSI - ENCODE_OSD_ELEMENT(1, 0, 24, 13), // OSD_STOPWATCH - ENCODE_OSD_ELEMENT(1, 0, 4, 6), // OSD_SYSTEM_STATUS - ENCODE_OSD_ELEMENT(1, 0, 1, 1), // OSD_THROTTLE - ENCODE_OSD_ELEMENT(0, 0, 1, 1), // OSD_VTX_CHANNEL - ENCODE_OSD_ELEMENT(1, 0, 1, 14), // OSD_CURRENT_DRAW - ENCODE_OSD_ELEMENT(0, 0, 14, 6), // OSD_CROSSHAIR - ENCODE_OSD_ELEMENT(1, 0, 1, 13), // OSD_CURRENT_DRAWN - }, - .elements_hd = { - ENCODE_OSD_ELEMENT(1, 1, 19, 0), // OSD_CALLSIGN - ENCODE_OSD_ELEMENT(1, 0, 21, 17), // OSD_CELL_COUNT - ENCODE_OSD_ELEMENT(0, 0, 0, 17), // OSD_FUELGAUGE_VOLTS - ENCODE_OSD_ELEMENT(1, 0, 24, 17), // OSD_FILTERED_VOLTS - ENCODE_OSD_ELEMENT(1, 0, 44, 17), // OSD_GYRO_TEMP - ENCODE_OSD_ELEMENT(1, 0, 20, 16), // OSD_FLIGHT_MODE - ENCODE_OSD_ELEMENT(1, 0, 44, 0), // OSD_RSSI - ENCODE_OSD_ELEMENT(1, 0, 44, 16), // OSD_STOPWATCH - ENCODE_OSD_ELEMENT(1, 0, 14, 8), // OSD_SYSTEM_STATUS - ENCODE_OSD_ELEMENT(1, 0, 0, 0), // OSD_THROTTLE - ENCODE_OSD_ELEMENT(0, 0, 0, 0), // OSD_VTX_CHANNEL - ENCODE_OSD_ELEMENT(1, 0, 0, 17), // OSD_CURRENT_DRAW - ENCODE_OSD_ELEMENT(0, 0, 15, 8), // OSD_CROSSHAIR - ENCODE_OSD_ELEMENT(1, 0, 0, 16), // OSD_CURRENT_DRAWN + .guac_mode = 0, + .profiles = { + [OSD_PROFILE_1] = { + .callsign = "QUICKSILVER", + .elements = { + ENCODE_OSD_ELEMENT(1, 1, 9, 1, 19, 0), // OSD_CALLSIGN + ENCODE_OSD_ELEMENT(1, 0, 11, 14, 21, 17), // OSD_CELL_COUNT + ENCODE_OSD_ELEMENT(0, 0, 1, 14, 0, 17), // OSD_FUELGAUGE_VOLTS + ENCODE_OSD_ELEMENT(1, 0, 14, 14, 24, 17), // OSD_FILTERED_VOLTS + ENCODE_OSD_ELEMENT(1, 0, 24, 14, 44, 17), // OSD_GYRO_TEMP + ENCODE_OSD_ELEMENT(1, 0, 10, 13, 20, 16), // OSD_FLIGHT_MODE + ENCODE_OSD_ELEMENT(1, 0, 24, 1, 44, 0), // OSD_RSSI + ENCODE_OSD_ELEMENT(1, 0, 24, 13, 44, 16), // OSD_STOPWATCH + ENCODE_OSD_ELEMENT(1, 0, 4, 6, 14, 8), // OSD_SYSTEM_STATUS + ENCODE_OSD_ELEMENT(1, 0, 1, 1, 0, 0), // OSD_THROTTLE + ENCODE_OSD_ELEMENT(0, 0, 1, 1, 0, 0), // OSD_VTX_CHANNEL + ENCODE_OSD_ELEMENT(1, 0, 1, 14, 0, 17), // OSD_CURRENT_DRAW + ENCODE_OSD_ELEMENT(0, 0, 14, 6, 15, 8), // OSD_CROSSHAIR + ENCODE_OSD_ELEMENT(1, 0, 1, 13, 0, 16), // OSD_CURRENT_DRAWN + }, + }, + [OSD_PROFILE_2] = { + .callsign = "QUICKSILVER", + .elements = { + ENCODE_OSD_ELEMENT(0, 1, 9, 1, 19, 0), // OSD_CALLSIGN + ENCODE_OSD_ELEMENT(0, 0, 11, 14, 21, 17), // OSD_CELL_COUNT + ENCODE_OSD_ELEMENT(0, 0, 1, 14, 0, 17), // OSD_FUELGAUGE_VOLTS + ENCODE_OSD_ELEMENT(0, 0, 14, 14, 24, 17), // OSD_FILTERED_VOLTS + ENCODE_OSD_ELEMENT(0, 0, 24, 14, 44, 17), // OSD_GYRO_TEMP + ENCODE_OSD_ELEMENT(0, 0, 10, 13, 20, 16), // OSD_FLIGHT_MODE + ENCODE_OSD_ELEMENT(0, 0, 24, 1, 44, 0), // OSD_RSSI + ENCODE_OSD_ELEMENT(0, 0, 24, 13, 44, 16), // OSD_STOPWATCH + ENCODE_OSD_ELEMENT(0, 0, 4, 6, 14, 8), // OSD_SYSTEM_STATUS + ENCODE_OSD_ELEMENT(0, 0, 1, 1, 0, 0), // OSD_THROTTLE + ENCODE_OSD_ELEMENT(0, 0, 1, 1, 0, 0), // OSD_VTX_CHANNEL + ENCODE_OSD_ELEMENT(0, 0, 1, 14, 0, 17), // OSD_CURRENT_DRAW + ENCODE_OSD_ELEMENT(0, 0, 14, 6, 15, 8), // OSD_CROSSHAIR + ENCODE_OSD_ELEMENT(0, 0, 1, 13, 0, 16), // OSD_CURRENT_DRAWN + }, + }, }, + }, .blackbox = { #ifdef BLACKBOX_DEBUG_FLAGS @@ -543,6 +553,7 @@ MOTOR_MEMBERS SERIAL_MEMBERS FILTER_PARAMETER_MEMBERS FILTER_MEMBERS +OSD_PROFILE_MEMBERS OSD_MEMBERS VOLTAGE_MEMBERS PID_RATE_MEMBERS @@ -617,6 +628,7 @@ MOTOR_MEMBERS SERIAL_MEMBERS FILTER_PARAMETER_MEMBERS FILTER_MEMBERS +OSD_PROFILE_MEMBERS OSD_MEMBERS VOLTAGE_MEMBERS PID_RATE_MEMBERS diff --git a/src/core/profile.h b/src/core/profile.h index afb09667d..ea139788e 100644 --- a/src/core/profile.h +++ b/src/core/profile.h @@ -9,7 +9,7 @@ #define OSD_NUMBER_ELEMENTS 32 -#define PROFILE_VERSION MAKE_SEMVER(0, 2, 4) +#define PROFILE_VERSION MAKE_SEMVER(0, 2, 5) // Rates typedef enum { @@ -285,19 +285,32 @@ typedef struct { MEMBER(hdzero, uint8_t) \ END_STRUCT() +typedef enum { + OSD_PROFILE_1, + OSD_PROFILE_2, + OSD_PROFILE_MAX, +} __attribute__((__packed__)) osd_profiles_t; + typedef struct { - uint8_t guac_mode; uint8_t callsign[36]; uint32_t elements[OSD_NUMBER_ELEMENTS]; - uint32_t elements_hd[OSD_NUMBER_ELEMENTS]; +} profile_osd_profile_t; + +#define OSD_PROFILE_MEMBERS \ + START_STRUCT(profile_osd_profile_t) \ + TSTR_MEMBER(callsign, 36) \ + ARRAY_MEMBER(elements, OSD_NUMBER_ELEMENTS, uint32_t) \ + END_STRUCT() + +typedef struct { + uint8_t guac_mode; + profile_osd_profile_t profiles[OSD_PROFILE_MAX]; } profile_osd_t; -#define OSD_MEMBERS \ - START_STRUCT(profile_osd_t) \ - MEMBER(guac_mode, uint8_t) \ - TSTR_MEMBER(callsign, 36) \ - ARRAY_MEMBER(elements, OSD_NUMBER_ELEMENTS, uint32_t) \ - ARRAY_MEMBER(elements_hd, OSD_NUMBER_ELEMENTS, uint32_t) \ +#define OSD_MEMBERS \ + START_STRUCT(profile_osd_t) \ + MEMBER(guac_mode, uint8_t) \ + ARRAY_MEMBER(profiles, OSD_PROFILE_MAX, profile_osd_profile_t) \ END_STRUCT() typedef struct { diff --git a/src/osd/menu.c b/src/osd/menu.c index 202216238..0c6586a9a 100644 --- a/src/osd/menu.c +++ b/src/osd/menu.c @@ -21,8 +21,6 @@ typedef struct { static osd_menu_state_t menu_state; -extern osd_system_t osd_system; - void osd_menu_start() { menu_state.onscreen_elements = 0; menu_state.active_elements = 0; diff --git a/src/osd/render.c b/src/osd/render.c index 3febc86d1..7f372ab5a 100644 --- a/src/osd/render.c +++ b/src/osd/render.c @@ -7,7 +7,6 @@ #include "core/profile.h" #include "core/project.h" #include "core/scheduler.h" -#include "driver/osd/osd.h" #include "driver/reset.h" #include "flight/control.h" #include "io/blackbox_device.h" @@ -121,11 +120,23 @@ uint8_t osd_attr(osd_element_t *el) { return el->attribute ? OSD_ATTR_INVERT : OSD_ATTR_TEXT; } +static osd_profiles_t osd_profile_index() { + return rx_aux_on(AUX_OSD_PROFILE) ? OSD_PROFILE_2 : OSD_PROFILE_1; +} + +static profile_osd_profile_t *osd_profile() { + return &profile.osd.profiles[osd_profile_index()]; +} + static uint32_t *osd_elements() { - if (osd_system == OSD_SYS_HD) { - return profile.osd.elements_hd; - } - return profile.osd.elements; + return osd_profile()->elements; +} + +static void osd_start_el(osd_element_t *el) { + if (osd_system == OSD_SYS_HD) + osd_start(osd_attr(el), el->pos_hd_x, el->pos_hd_y); + else + osd_start(osd_attr(el), el->pos_sd_x, el->pos_sd_y); } void osd_display_reset() { @@ -290,7 +301,7 @@ static void print_osd_flightmode(osd_element_t *el) { flightmode = 0; } - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_data(flightmode_labels[flightmode], 10); } @@ -301,13 +312,13 @@ static void print_osd_rssi(osd_element_t *el) { lpf(&rx_rssi_filt, state.rx_rssi, lpfcalc(state.looptime * 1e6f * 133.0f, 2e6f)); // 2 second filtertime and 15hz refresh rate @4k, 30hz@ 8k loop - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_uint(rx_rssi_filt - 0.5f, 4); osd_write_char(ICON_RSSI); } static void print_osd_crosshair(osd_element_t *el) { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_char(ICON_CROSSHAIR_1); osd_write_char(ICON_CROSSHAIR_2); osd_write_char(ICON_CROSSHAIR_3); @@ -322,7 +333,7 @@ static void print_osd_armtime(osd_element_t *el) { time_s -= 3600; } - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); const uint32_t minutes = time_s / 60; osd_write_uint(minutes / 10, 1); @@ -338,7 +349,7 @@ static void print_osd_armtime(osd_element_t *el) { // print the current vtx settings as Band:Channel:Power static void print_osd_vtx(osd_element_t *el) { #ifdef USE_VTX - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); switch (vtx_settings.band) { case VTX_BAND_A: @@ -394,8 +405,8 @@ static void osd_display_regular() { switch (osd_state.element) { case OSD_CALLSIGN: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); - osd_write_str((const char *)profile.osd.callsign); + osd_start_el(el); + osd_write_str((const char *)osd_profile()->callsign); osd_state.element++; break; @@ -403,9 +414,9 @@ static void osd_display_regular() { case OSD_CELL_COUNT: { if (!flags.lowbatt) { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); } else { - osd_start(OSD_ATTR_BLINK | OSD_ATTR_INVERT, el->pos_x, el->pos_y); + osd_start(OSD_ATTR_BLINK | OSD_ATTR_INVERT, pos_x(el), pos_y(el)); } osd_write_uint(state.lipo_cell_count, 1); osd_write_char('S'); @@ -415,7 +426,7 @@ static void osd_display_regular() { } case OSD_FUELGAUGE_VOLTS: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_float(state.vbat_compensated_cell_avg, 4, 1); osd_write_char(ICON_GAUGE); @@ -424,7 +435,7 @@ static void osd_display_regular() { } case OSD_FILTERED_VOLTS: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_float(state.vbat_cell_avg, 4, 1); osd_write_char(ICON_VOLT); @@ -433,7 +444,7 @@ static void osd_display_regular() { } case OSD_GYRO_TEMP: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_int(state.gyro_temp, 4); osd_write_char(ICON_CELSIUS); @@ -466,7 +477,7 @@ static void osd_display_regular() { } case OSD_THROTTLE: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); const float throttle = state.rx_filtered.throttle * 100.0f; if (profile.osd.guac_mode && throttle > 99.0f) { osd_write_str("GUAC"); @@ -491,7 +502,7 @@ static void osd_display_regular() { } case OSD_CURRENT_DRAW: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_float(state.ibat_filtered / 1000.0f, 4, 2); osd_write_char(ICON_AMP); @@ -500,7 +511,7 @@ static void osd_display_regular() { } case OSD_CURRENT_DRAWN: { - osd_start(osd_attr(el), el->pos_x, el->pos_y); + osd_start_el(el); osd_write_float(state.ibat_drawn, 4, 2); osd_write_char(ICON_MAH); @@ -660,10 +671,16 @@ void osd_display() { osd_display_reset(); break; - case OSD_SCREEN_REGULAR: + case OSD_SCREEN_REGULAR: { + static osd_profiles_t last_osd_profile_index = OSD_PROFILE_MAX; + if (last_osd_profile_index != osd_profile_index()) { + last_osd_profile_index = osd_profile_index(); + osd_update_screen(OSD_SCREEN_CLEAR); + break; + } osd_display_regular(); break; - + } case OSD_SCREEN_MAIN_MENU: { osd_menu_start(); osd_menu_header("MENU"); @@ -901,12 +918,13 @@ void osd_display() { osd_menu_select_enum_adjust(4, OSD_AUTO, "STICK BOOST", 17, &profile.receiver.aux[AUX_STICK_BOOST_PROFILE], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); // PAGE 2 - osd_menu_select_enum_adjust(4, OSD_AUTO, "RATE", 17, &profile.receiver.aux[AUX_RATE_PROFILE], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); osd_menu_select_enum_adjust(4, OSD_AUTO, "BUZZER", 17, &profile.receiver.aux[AUX_BUZZER_ENABLE], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); osd_menu_select_enum_adjust(4, OSD_AUTO, "TURTLE", 17, &profile.receiver.aux[AUX_TURTLE], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); osd_menu_select_enum_adjust(4, OSD_AUTO, "MOTOR TEST", 17, &profile.receiver.aux[AUX_MOTOR_TEST], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); osd_menu_select_enum_adjust(4, OSD_AUTO, "FPV SWITCH", 17, &profile.receiver.aux[AUX_FPV_SWITCH], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); osd_menu_select_enum_adjust(4, OSD_AUTO, "BLACKBOX", 17, &profile.receiver.aux[AUX_BLACKBOX], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); + osd_menu_select_enum_adjust(4, OSD_AUTO, "PREARM", 17, &profile.receiver.aux[AUX_PREARM], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); + osd_menu_select_enum_adjust(4, OSD_AUTO, "OSD PROFILE", 17, &profile.receiver.aux[AUX_OSD_PROFILE], aux_channel_labels, AUX_CHANNEL_0, AUX_CHANNEL_11); } osd_menu_scroll_finish(4); @@ -1071,11 +1089,17 @@ void osd_display() { osd_element_t *el = (osd_element_t *)(osd_elements() + i); osd_menu_select(3, OSD_AUTO, osd_element_labels[i]); - if (osd_menu_select_int(20, OSD_AUTO, el->pos_x, 3)) { - el->pos_x = osd_menu_adjust_int(el->pos_x, 1, 0, osd_system == OSD_SYS_HD ? HD_COLS : SD_COLS); + if (osd_menu_select_int(20, OSD_AUTO, pos_x(el), 3)) { + if (osd_system == OSD_SYS_HD) + el->pos_hd_x = osd_menu_adjust_int(el->pos_hd_x, 1, 0, HD_ROWS); + else + el->pos_sd_x = osd_menu_adjust_int(el->pos_sd_x, 1, 0, SD_ROWS); } - if (osd_menu_select_int(26, OSD_AUTO, el->pos_y, 3)) { - el->pos_y = osd_menu_adjust_int(el->pos_y, 1, 0, osd_system == OSD_SYS_HD ? HD_ROWS : SD_ROWS); + if (osd_menu_select_int(26, OSD_AUTO, pos_y(el), 3)) { + if (osd_system == OSD_SYS_HD) + el->pos_hd_y = osd_menu_adjust_int(el->pos_hd_y, 1, 0, HD_ROWS); + else + el->pos_sd_y = osd_menu_adjust_int(el->pos_sd_y, 1, 0, SD_ROWS); } } osd_menu_scroll_finish(3); @@ -1113,8 +1137,8 @@ void osd_display() { osd_menu_header("CALLSIGN"); osd_menu_select(1, 5, "EDIT:"); - if (osd_menu_select_str(8, 5, (char *)profile.osd.callsign)) { - osd_menu_adjust_str((char *)profile.osd.callsign); + if (osd_menu_select_str(8, 5, (char *)osd_profile()->callsign)) { + osd_menu_adjust_str((char *)osd_profile()->callsign); } osd_menu_label(8, 6, "-------------------"); diff --git a/src/osd/render.h b/src/osd/render.h index 83af1de52..1727742c5 100644 --- a/src/osd/render.h +++ b/src/osd/render.h @@ -2,6 +2,8 @@ #include +#include "driver/osd/osd.h" + #define OSD_HISTORY_SIZE 8 typedef enum { @@ -74,32 +76,19 @@ typedef enum { OSD_ELEMENT_MAX } osd_elements_t; -/* -screen elements characteristics written like registers in a 32bit binany number -BIT -0 - 0 is display element inactive , 1 is display element active -1 - 0 is TEXT, 1 is INVERT -2:10 - the X screen position (column) -11:17 - the Y screen position (row) -17:32 - not currently used -*/ - -typedef enum { - ACTIVE = 0, - ATTRIBUTE = 1, - POSITIONX = 2, - POSITIONY = 3, -} osd_element_attrs_t; - typedef struct { uint32_t active : 1; uint32_t attribute : 1; - uint32_t pos_x : 8; - uint32_t pos_y : 8; - uint32_t _unused : 14; + uint32_t pos_sd_x : 5; + uint32_t pos_sd_y : 5; + uint32_t pos_hd_x : 7; + uint32_t pos_hd_y : 7; + uint32_t _unused : 6; } __attribute__((packed)) osd_element_t; -#define ENCODE_OSD_ELEMENT(active, attr, x, y) ((y << 10) | (x << 2) | (attr << 1) | active) +#define ENCODE_OSD_ELEMENT(active, attr, sd_x, sd_y, hd_x, hd_y) ((hd_y << 20) | (hd_x << 12) | (sd_y << 7) | (sd_x << 2) | (attr << 1) | active) +#define pos_x(el) (osd_system == OSD_SYS_HD ? el->pos_hd_x : el->pos_sd_x) +#define pos_y(el) (osd_system == OSD_SYS_HD ? el->pos_hd_y : el->pos_sd_y) typedef enum { OSD_PHASE_CLEAR, @@ -131,6 +120,7 @@ typedef struct { } osd_state_t; extern osd_state_t osd_state; +extern osd_system_t osd_system; void osd_init(); void osd_display(); diff --git a/src/osd/status.c b/src/osd/status.c index 3a69aa941..98ae34656 100644 --- a/src/osd/status.c +++ b/src/osd/status.c @@ -100,7 +100,7 @@ static bool osd_status_print(osd_element_t *el) { switch (current_status.state) { case PRINT_START: - osd_start(osd_attr(el) | OSD_ATTR_BLINK, el->pos_x, el->pos_y); + osd_start(osd_attr(el) | OSD_ATTR_BLINK, pos_x(el), pos_y(el)); osd_write_data(current_status.label, LABEL_LEN); if (current_status.mode == MODE_HOLD) { @@ -119,7 +119,7 @@ static bool osd_status_print(osd_element_t *el) { return false; case PRINT_CLEAR: - osd_start(osd_attr(el) | OSD_ATTR_BLINK, el->pos_x, el->pos_y); + osd_start(osd_attr(el) | OSD_ATTR_BLINK, pos_x(el), pos_y(el)); for (uint32_t i = 0; i < LABEL_LEN; i++) { osd_write_char(' '); } diff --git a/src/rx/rx.h b/src/rx/rx.h index a5998a94e..e814b2871 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -63,7 +63,7 @@ typedef enum { AUX_RACEMODE, AUX_HORIZON, AUX_STICK_BOOST_PROFILE, - AUX_RATE_PROFILE, + UNUSED_AUX_HIGH_RATES, // used to multiply rates by a constant factor AUX_BUZZER_ENABLE, AUX_TURTLE, AUX_MOTOR_TEST, @@ -71,6 +71,7 @@ typedef enum { AUX_FPV_SWITCH, AUX_BLACKBOX, AUX_PREARM, + AUX_OSD_PROFILE, AUX_FUNCTION_MAX } __attribute__((__packed__)) aux_function_t;