diff --git a/src/gui/menu_model.cpp b/src/gui/menu_model.cpp index f2f9da3c6..bbc01babb 100644 --- a/src/gui/menu_model.cpp +++ b/src/gui/menu_model.cpp @@ -1589,11 +1589,22 @@ uint8_t editDelay(const uint8_t y, const uint8_t event, const uint8_t attr, cons #if defined(FLIGHT_MODES) #if defined(CPUARM) -#define FlightModesType uint16_t + #define FlightModesType uint16_t #else -#define FlightModesType uint8_t + #define FlightModesType uint8_t #endif +void displayFlightModes(uint8_t x, uint8_t y, FlightModesType value) +{ + uint8_t p = MAX_PHASES; + do { + --p; + if (!(value & (1<
= 212 - #define EXPO_LINE_WEIGHT_POS 7*FW - #define EXPO_LINE_EXPO_POS 12*FW - #define EXPO_LINE_SWITCH_POS 13*FW+4 - #define EXPO_LINE_SIDE_POS 19*FW + #define EXPO_LINE_WEIGHT_POS 7*FW-1 + #define EXPO_LINE_EXPO_POS 11*FW + #define EXPO_LINE_SWITCH_POS 11*FW+5 + #define EXPO_LINE_SIDE_POS 15*FW+2 #define EXPO_LINE_SELECT_POS 18 -#else +#elif defined(CPUARM) #define EXPO_LINE_WEIGHT_POS 7*FW-1 #define EXPO_LINE_EXPO_POS 10*FW+5 #define EXPO_LINE_SWITCH_POS 11*FW+2 + #define EXPO_LINE_SIDE_POS 14*FW+2 + #define EXPO_LINE_SELECT_POS 24 +#else + #define EXPO_LINE_WEIGHT_POS 7*FW-1 + #define EXPO_LINE_EXPO_POS 11*FW + #define EXPO_LINE_SWITCH_POS 11*FW+4 #if MAX_PHASES == 6 - #define EXPO_LINE_SIDE_POS 14*FW+2 + #define EXPO_LINE_SIDE_POS 15*FW #else - #define EXPO_LINE_SIDE_POS 14*FW+5 + #define EXPO_LINE_SIDE_POS 15*FW+2 #endif #define EXPO_LINE_SELECT_POS 24 #endif @@ -3203,10 +3220,13 @@ void menuModelExpoMix(uint8_t expo, uint8_t event) if (ed->mode!=3) lcd_putc(EXPO_LINE_SIDE_POS, y, ed->mode == 2 ? 126 : 127); -#if defined(CPUARM) +#if defined(CPUARM) && LCD_W >= 212 + displayFlightModes(LCD_W-sizeof(ed->name)*FW-MENUS_SCROLLBAR_WIDTH-FW-3, y, ed->phases); + if (ed->name[0]) lcd_putsnAtt(LCD_W-sizeof(ed->name)*FW-MENUS_SCROLLBAR_WIDTH, y, ed->name, sizeof(ed->name), ZCHAR | (isExpoActive(i) ? BOLD : 0)); +#elif defined(CPUARM) if (ed->name[0]) lcd_putsnAtt(LCD_W-sizeof(ed->name)*FW-MENUS_SCROLLBAR_WIDTH, y, ed->name, sizeof(ed->name), ZCHAR | (isExpoActive(i) ? BOLD : 0)); #else - editFlightModes(LCD_W-MAX_PHASES*FW-MENUS_SCROLLBAR_WIDTH, y, 0, ed->phases, 0); + displayFlightModes(LCD_W-FW-MENUS_SCROLLBAR_WIDTH, y, ed->phases); #endif } else { diff --git a/src/gui/menus.h b/src/gui/menus.h index 95b9aedfa..0506444e8 100644 --- a/src/gui/menus.h +++ b/src/gui/menus.h @@ -46,20 +46,20 @@ inline void displayColumnHeader(const char **headers, uint8_t index) } #if LCD_W >= 212 -#if defined(TRANSLATIONS_FR) - #define MENU_COLUMNS 1 - #define COLUMN_X 0 + #if defined(TRANSLATIONS_FR) + #define MENU_COLUMNS 1 + #define COLUMN_X 0 + #else + #define MENU_COLUMNS 2 + #endif + #define MENUS_SCROLLBAR_WIDTH 2 + #define MENU_COLUMN2_X (14 + LCD_W / 2) + #define lcd_putsColumnLeft(x, y, str) lcd_puts((x > (LCD_W-10*FW-MENUS_SCROLLBAR_WIDTH)) ? MENU_COLUMN2_X : 0, y, str) #else - #define MENU_COLUMNS 2 -#endif -#define MENUS_SCROLLBAR_WIDTH 2 -#define MENU_COLUMN2_X (14 + LCD_W / 2) -#define lcd_putsColumnLeft(x, y, str) lcd_puts((x > (LCD_W-10*FW-MENUS_SCROLLBAR_WIDTH)) ? MENU_COLUMN2_X : 0, y, str) -#else -#define MENUS_SCROLLBAR_WIDTH 0 -#define MENU_COLUMNS 1 -#define COLUMN_X 0 -#define lcd_putsColumnLeft(x, y, str) lcd_putsLeft(y, str) + #define MENUS_SCROLLBAR_WIDTH 0 + #define MENU_COLUMNS 1 + #define COLUMN_X 0 + #define lcd_putsColumnLeft(x, y, str) lcd_putsLeft(y, str) #endif // Menus related stuff ... diff --git a/src/opentx.cpp b/src/opentx.cpp index f823c7430..4d2253948 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -996,7 +996,7 @@ bool __getSwitch(int8_t swtch) #if defined(FRSKY) // Telemetry if (cs->v1 >= MIXSRC_FIRST_TELEM) { - if (!TELEMETRY_STREAMING() && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2) + if ((!TELEMETRY_STREAMING() && cs->v1 >= MIXSRC_FIRST_TELEM+TELEM_TM2) || IS_FAI_FORBIDDEN(cs->v1-1)) return swtch > 0 ? false : true; #if defined (PCBTARANIS) @@ -2283,6 +2283,9 @@ tmr10ms_t lastFunctionTime[NUM_CFN] = { 0 }; #if defined(VOICE) PLAY_FUNCTION(playValue, uint8_t idx) { + if (IS_FAI_FORBIDDEN(idx)) + return; + getvalue_t val = getValue(idx); switch (idx) { @@ -2605,7 +2608,7 @@ void evalFunctions() #endif #if defined(CPUARM) && defined(SDCARD) - else if (!IS_FAI_ENABLED() && (CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_VALUE)) { + else if (CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_VALUE) { tmr10ms_t tmr10ms = get_tmr10ms(); uint8_t repeatParam = CFN_PLAY_REPEAT(sd); if (!lastFunctionTime[i] || (repeatParam && (signed)(tmr10ms-lastFunctionTime[i])>=500*repeatParam)) { @@ -2620,7 +2623,7 @@ void evalFunctions() } } } - else if (!IS_FAI_ENABLED() && (CFN_FUNC(sd) == FUNC_BACKGND_MUSIC)) { + else if (CFN_FUNC(sd) == FUNC_BACKGND_MUSIC) { if (!IS_PLAYING(i+1)) { playCustomFunctionFile(sd, i+1); } @@ -2634,7 +2637,7 @@ void evalFunctions() } } #elif defined(VOICE) - else if (!IS_FAI_ENABLED() && (CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_BOTH || CFN_FUNC(sd) == FUNC_PLAY_VALUE)) { + else if (CFN_FUNC(sd) == FUNC_PLAY_TRACK || CFN_FUNC(sd) == FUNC_PLAY_BOTH || CFN_FUNC(sd) == FUNC_PLAY_VALUE) { tmr10ms_t tmr10ms = get_tmr10ms(); uint8_t repeatParam = CFN_PLAY_REPEAT(sd); if (!lastFunctionTime[i] || (CFN_FUNC(sd)==FUNC_PLAY_BOTH && active!=(bool)(activeFnSwitches&switch_mask)) || (repeatParam && (signed)(tmr10ms-lastFunctionTime[i])>=1000*repeatParam)) { diff --git a/src/opentx.h b/src/opentx.h index 5b905d724..9588ec8c8 100644 --- a/src/opentx.h +++ b/src/opentx.h @@ -209,6 +209,8 @@ #define IF_FAI_CHOICE(x) #endif +#define IS_FAI_FORBIDDEN(idx) (IS_FAI_ENABLED() && idx > MIXSRC_FIRST_TELEM-1+TELEM_A2-1) + #if defined(SIMU) #ifndef FORCEINLINE #define FORCEINLINE