diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index a335c535b..3fbf74e30 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -4476,7 +4476,7 @@ void menuModelCustomSwitches(uint8_t event) int8_t v1_min=0, v1_max=MIXSRC_LAST_TELEM, v2_min=0, v2_max=MIXSRC_LAST_TELEM; #endif - if (cstate == CS_VBOOL || IS_VSTICKY(cstate)) { + if (cstate == CS_VBOOL || cstate == CS_VSTICKY) { putsSwitches(CSW_2ND_COLUMN, y, cs->v1, attr1); putsSwitches(CSW_3RD_COLUMN, y, cs->v2, attr2); v1_min = SWSRC_OFF+1; v1_max = SWSRC_ON-1; diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index e1de61641..7bfabb139 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -1053,31 +1053,6 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) } #endif -#if !defined(PCBSTD) - else if (idx >= SWSRC_TRAINER_SHORT) { - idx -= SWSRC_TRAINER_SHORT; - char suffix = (idx & 1) ? CHR_LONG : CHR_SHORT; -#if ROTARY_ENCODERS > 0 - if (idx >= 2) { - idx -= 2; - lcd_putsiAtt(x, y, STR_VRENCODERS, idx/2, att); - } - else -#endif - { - lcd_putsiAtt(x, y, STR_VSWITCHES, SWSRC_TRAINER-1, att); - } - return lcd_putcAtt(lcdLastPos, y, suffix, att); - } -#endif - - if (idx > SWSRC_ON) { - idx -= SWSRC_ON; - if (idx != SWSRC_ON && (~att & STRCONDENSED)) { - lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att); - return lcd_putcAtt(lcdLastPos, y, CHR_TOGGLE, att); - } - } lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att); } diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 8bb233a52..ba75d686b 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -740,6 +740,12 @@ enum Functions { FUNC_MAX }; +#if defined(CPUARM) + #define IS_PLAY_BOTH_FUNC(sd) (0) +#else + #define IS_PLAY_BOTH_FUNC(sd) (CFN_FUNC(sd) == FUNC_PLAY_BOTH) +#endif + #if defined(GVARS) #define IS_ADJUST_GV_FUNCTION(sd) (CFN_FUNC(sd) >= FUNC_ADJUST_GV1 && CFN_FUNC(sd) <= FUNC_ADJUST_GVLAST) #else @@ -1198,26 +1204,12 @@ enum SwitchSources { #endif SWSRC_ON, - - SWSRC_FIRST_MOMENT_SWITCH, - SWSRC_LAST_MOMENT_SWITCH = SWSRC_FIRST_MOMENT_SWITCH+SWSRC_LAST_CSW, - -#if !defined(PCBSTD) - SWSRC_TRAINER_SHORT, - SWSRC_TRAINER_LONG, -#endif - -#if ROTARY_ENCODERS > 0 - SWSRC_FIRST_ROTENC_SWITCH, - SWSRC_LAST_ROTENC_SWITCH = SWSRC_FIRST_ROTENC_SWITCH+(2*ROTARY_ENCODERS)-1, -#endif - - SWSRC_COUNT, - SWSRC_FIRST = -SWSRC_LAST_MOMENT_SWITCH, - SWSRC_LAST = SWSRC_COUNT-1, - SWSRC_OFF = -SWSRC_ON, + SWSRC_TRAINER = SWSRC_SW1-1, + + SWSRC_FIRST = SWSRC_OFF, + SWSRC_LAST = SWSRC_ON }; enum MixSources { diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 67a9e16c0..27dd80868 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -448,13 +448,7 @@ CustomSwData *cswAddress(uint8_t idx) uint8_t cswFamily(uint8_t func) { - return (funcv1); getvalue_t y; @@ -3093,100 +3085,11 @@ void evalFunctions() if (swtch) { MASK_FUNC_TYPE function_mask = (CFN_FUNC(sd) >= FUNC_TRAINER ? ((MASK_FUNC_TYPE)1 << (CFN_FUNC(sd)-FUNC_TRAINER)) : 0); MASK_CFN_TYPE switch_mask = ((MASK_CFN_TYPE)1 << i); - uint8_t momentary = 0; - -#if !defined(PCBSTD) - - #define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \ - (short_long==1 && !active && mSwitchDuration[mswitch]>0 && mSwitchDuration[mswitch] NUM_SWITCH+1) { - momentary = 1; - swtch -= NUM_SWITCH+1; - } - if (swtch < -NUM_SWITCH-1) { - momentary = 1; - swtch += NUM_SWITCH+1; - } bool active = getSwitch(swtch); if (active) newActiveSwitches |= switch_mask; - if (momentary || short_long) { -#if !defined(PCBSTD) - bool swState = active; -#endif - - if (MOMENTARY_START_TEST()) { - - if (short_long) { - active = false; - momentary = true; - } - else { - active = !(activeFnSwitches & switch_mask); -#if !defined(CPUARM) - if (CFN_FUNC(sd) == FUNC_PLAY_BOTH && !active) { - momentary = true; - } - else -#endif - { - momentary = false; - } - } - } - else if (swtch == SWSRC_ON) { - active = false; - momentary = false; - } - else { - active = (activeFnSwitches & switch_mask); - momentary = false; - } -#if !defined(PCBSTD) - if (short_long && !(mSwitchDurationIncremented & (1<func == CS_STICKY) { uint16_t & lastValue = (uint16_t &)csLastValue[i]; bool before = (lastValue & (1<<15)); @@ -4075,7 +3977,6 @@ void doMixerCalculations() } } } -#endif } if (s_cnt_1s >= 10) { // 1sec diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 6b704b30b..7cbbd4aaa 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -639,9 +639,7 @@ enum CswFunctions { CS_DIFFEGREATER, CS_ADIFFEGREATER, CS_TIMER, -#if defined(CPUARM) CS_STICKY, -#endif CS_COUNT, CS_MAXF = CS_COUNT-1 }; @@ -656,12 +654,6 @@ enum CswFunctions { uint8_t cswFamily(uint8_t func); int16_t cswTimerValue(int8_t val); -#if defined(CPUARM) - #define IS_VSTICKY(val) ((val) == CS_VSTICKY) -#else - #define IS_VSTICKY(val) (0) -#endif - #define NUM_CYC 3 #define NUM_CAL_PPM 4 #define NUM_PPM 8 diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 6e228f79b..045062458 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -150,12 +150,12 @@ #define LEN_VMIXTRIMS "\003" #define TR_VMIXTRIMS "OFF""ON\0""Rud""Ele""Thr""Ail" -#if defined(CPUARM) +#if defined(PCBTARANIS) #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Stcky" #else - #define TR_CSWTIMER "TIM\0" - #define TR_CSWSTICKY + #define TR_CSWTIMER "Tim\0 " + #define TR_CSWSTICKY "Stky\0" #endif #define LEN_VCSWFUNC "\005"