diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index f34c9f4a2..35a03e197 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -689,6 +689,8 @@ class SwashRingData { // Swash Ring data bool invertCOL; unsigned int type; RawSource collectiveSource; + RawSource aileronSource; + RawSource elevatorSource; unsigned int value; void clear() { memset(this, 0, sizeof(SwashRingData)); } }; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 93510b2a2..e2685a69a 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -730,6 +730,10 @@ class HeliField: public StructField { Append(new BoolField<1>(heli.invertCOL)); Append(new UnsignedField<5>(heli.type)); Append(new SourceField<8>(heli.collectiveSource, board, version, variant)); + if (IS_TARANIS(board) && version >= 217) { + Append(new SourceField<8>(heli.aileronSource, board, version, variant)); + Append(new SourceField<8>(heli.elevatorSource, board, version, variant)); + } //, FLAG_NOSWITCHES)); Fix shift in collective Append(new UnsignedField<8>(heli.value)); } diff --git a/radio/src/gui/9X/helpers.cpp b/radio/src/gui/9X/helpers.cpp index 68c73e750..ba3cc6624 100755 --- a/radio/src/gui/9X/helpers.cpp +++ b/radio/src/gui/9X/helpers.cpp @@ -208,11 +208,6 @@ bool isSwitchAvailableInTimers(int swtch) return isSwitchAvailable(swtch, TimersContext); } -bool isThrottleSourceAvailable(int source) -{ - return true; -} - bool isLogicalSwitchFunctionAvailable(int function) { return function != LS_FUNC_RANGE; diff --git a/radio/src/gui/9X/menu_model_heli.cpp b/radio/src/gui/9X/menu_model_heli.cpp index 5a79194e7..a6df1749d 100755 --- a/radio/src/gui/9X/menu_model_heli.cpp +++ b/radio/src/gui/9X/menu_model_heli.cpp @@ -61,7 +61,7 @@ void menuModelHeli(uint8_t event) break; case ITEM_HELI_COLLECTIVE: - g_model.swashR.collectiveSource = selectMenuItem(HELI_PARAM_OFS, y, STR_COLLECTIVE, NULL, g_model.swashR.collectiveSource, 0, MIXSRC_LAST_CH, attr, event); + g_model.swashR.collectiveSource = selectMenuItem(HELI_PARAM_OFS, y, STR_COLLECTIVE_SOURCE, NULL, g_model.swashR.collectiveSource, 0, MIXSRC_LAST_CH, attr, event); putsMixerSource(HELI_PARAM_OFS, y, g_model.swashR.collectiveSource, attr); break; diff --git a/radio/src/gui/9X/menu_model_inputs_mixes.cpp b/radio/src/gui/9X/menu_model_inputs_mixes.cpp index 77cbbc8ec..c55fd4761 100644 --- a/radio/src/gui/9X/menu_model_inputs_mixes.cpp +++ b/radio/src/gui/9X/menu_model_inputs_mixes.cpp @@ -282,7 +282,7 @@ bool swapExpoMix(uint8_t expo, uint8_t &idx, uint8_t up) enum ExposFields { CASE_CPUARM(EXPO_FIELD_NAME) EXPO_FIELD_WEIGHT, - CASE_9X(EXPO_FIELD_EXPO) + EXPO_FIELD_EXPO, CASE_CURVES(EXPO_FIELD_CURVE) CASE_FLIGHT_MODES(EXPO_FIELD_FLIGHT_MODES) EXPO_FIELD_SWITCH, @@ -311,7 +311,7 @@ void menuModelExpoOne(uint8_t event) { #if defined(CPUARM) case EXPO_FIELD_NAME: - editSingleName(EXPO_ONE_2ND_COLUMN-IF_9X(sizeof(ed->name)*FW), y, STR_EXPONAME, ed->name, sizeof(ed->name), event, attr); + editSingleName(EXPO_ONE_2ND_COLUMN-sizeof(ed->name)*FW, y, STR_EXPONAME, ed->name, sizeof(ed->name), event, attr); break; #endif @@ -353,16 +353,16 @@ void menuModelExpoOne(uint8_t event) #if defined(FLIGHT_MODES) case EXPO_FIELD_FLIGHT_MODES: - ed->flightModes = editFlightModes(EXPO_ONE_2ND_COLUMN-IF_9X(EXPO_ONE_FM_WIDTH), y, event, ed->flightModes, attr); + ed->flightModes = editFlightModes(EXPO_ONE_2ND_COLUMN-EXPO_ONE_FM_WIDTH, y, event, ed->flightModes, attr); break; #endif case EXPO_FIELD_SWITCH: - ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN-IF_9X(3*FW), y, ed->swtch, attr, event); + ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN-3*FW, y, ed->swtch, attr, event); break; case EXPO_FIELD_SIDE: - ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN-IF_9X(3*FW), y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event); + ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event); break; } y += FH; @@ -474,11 +474,11 @@ void menuModelMixOne(uint8_t event) #else if (m_posVert == MIX_FIELD_TRIM && md2->srcRaw > NUM_STICKS) #endif - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, CASE_9X(0) CASE_CURVES(0) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}) + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, 0, CASE_CURVES(0) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}) else - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, CASE_9X(1) CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, 1, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); #else - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, CASE_9X(1) CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {CASE_CPUARM(0) 0, 0, 0, 1, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); #endif #if MENU_COLUMNS > 1 diff --git a/radio/src/gui/9X/menu_model_setup.cpp b/radio/src/gui/9X/menu_model_setup.cpp index dbd46e702..efa855336 100644 --- a/radio/src/gui/9X/menu_model_setup.cpp +++ b/radio/src/gui/9X/menu_model_setup.cpp @@ -351,7 +351,7 @@ void menuModelSetup(uint8_t event) case ITEM_MODEL_THROTTLE_TRACE: { lcd_putsLeft(y, STR_TTRACE); - if (attr) CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, g_model.thrTraceSrc, NUM_POTS+NUM_CHNOUT, isThrottleSourceAvailable); + if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.thrTraceSrc, NUM_POTS+NUM_CHNOUT); uint8_t idx = g_model.thrTraceSrc + MIXSRC_Thr; if (idx > MIXSRC_Thr) idx += 1; diff --git a/radio/src/gui/Taranis/menu_model_heli.cpp b/radio/src/gui/Taranis/menu_model_heli.cpp index 6fa309780..e489569a1 100755 --- a/radio/src/gui/Taranis/menu_model_heli.cpp +++ b/radio/src/gui/Taranis/menu_model_heli.cpp @@ -37,31 +37,49 @@ enum menuModelHeliItems { ITEM_HELI_SWASHTYPE, - ITEM_HELI_COLLECTIVE, + ITEM_HELI_ELESOURCE, + ITEM_HELI_AILSOURCE, + ITEM_HELI_COLSOURCE, ITEM_HELI_SWASHRING, ITEM_HELI_ELEDIRECTION, ITEM_HELI_AILDIRECTION, - ITEM_HELI_COLDIRECTION + ITEM_HELI_COLDIRECTION, + ITEM_HELI_MAX }; #define HELI_PARAM_OFS (23*FW) void menuModelHeli(uint8_t event) { - SIMPLE_MENU(STR_MENUHELISETUP, menuTabModel, e_Heli, 7); + SIMPLE_MENU(STR_MENUHELISETUP, menuTabModel, e_Heli, ITEM_HELI_MAX); - uint8_t sub = m_posVert - 1; + int sub = m_posVert; - for (uint8_t i=0; i<6; i++) { + for (unsigned int i=0; i0) ? BLINK|INVERS : INVERS) : 0); - switch(i) { + int k = i+s_pgOfs; + LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS); + LcdFlags attr = (sub == k ? blink : 0); + + switch(k) { case ITEM_HELI_SWASHTYPE: g_model.swashR.type = selectMenuItem(HELI_PARAM_OFS, y, STR_SWASHTYPE, STR_VSWASHTYPE, g_model.swashR.type, 0, SWASH_TYPE_MAX, attr, event); break; - case ITEM_HELI_COLLECTIVE: - lcd_putsLeft(y, STR_COLLECTIVE); + case ITEM_HELI_ELESOURCE: + lcd_putsLeft(y, STR_ELEVATOR_SOURCE); + if (attr) CHECK_INCDEC_MODELSOURCE(event, g_model.swashR.elevatorSource, 0, MIXSRC_LAST_CH); + putsMixerSource(HELI_PARAM_OFS, y, g_model.swashR.elevatorSource, attr); + break; + + case ITEM_HELI_AILSOURCE: + lcd_putsLeft(y, STR_AILERON_SOURCE); + if (attr) CHECK_INCDEC_MODELSOURCE(event, g_model.swashR.aileronSource, 0, MIXSRC_LAST_CH); + putsMixerSource(HELI_PARAM_OFS, y, g_model.swashR.aileronSource, attr); + break; + + case ITEM_HELI_COLSOURCE: + lcd_putsLeft(y, STR_COLLECTIVE_SOURCE); if (attr) CHECK_INCDEC_MODELSOURCE(event, g_model.swashR.collectiveSource, 0, MIXSRC_LAST_CH); putsMixerSource(HELI_PARAM_OFS, y, g_model.swashR.collectiveSource, attr); break; diff --git a/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp b/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp index f398dcfd0..09e6506d1 100644 --- a/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp +++ b/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp @@ -335,7 +335,7 @@ void menuModelExpoOne(uint8_t event) break; case EXPO_FIELD_NAME: - editSingleName(EXPO_ONE_2ND_COLUMN-IF_9X(sizeof(ed->name)*FW), y, STR_EXPONAME, ed->name, sizeof(ed->name), event, attr); + editSingleName(EXPO_ONE_2ND_COLUMN, y, STR_EXPONAME, ed->name, sizeof(ed->name), event, attr); break; case EXPO_FIELD_SOURCE: @@ -369,16 +369,16 @@ void menuModelExpoOne(uint8_t event) #if defined(FLIGHT_MODES) case EXPO_FIELD_FLIGHT_MODES: - ed->flightModes = editFlightModes(EXPO_ONE_2ND_COLUMN-IF_9X(EXPO_ONE_FM_WIDTH), y, event, ed->flightModes, attr); + ed->flightModes = editFlightModes(EXPO_ONE_2ND_COLUMN, y, event, ed->flightModes, attr); break; #endif case EXPO_FIELD_SWITCH: - ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN-IF_9X(3*FW), y, ed->swtch, attr, event); + ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN, y, ed->swtch, attr, event); break; case EXPO_FIELD_SIDE: - ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN-IF_9X(3*FW), y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event); + ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event); break; case EXPO_FIELD_TRIM: diff --git a/radio/src/gui/Taranis/menu_model_setup.cpp b/radio/src/gui/Taranis/menu_model_setup.cpp index 1e9449c94..590702af6 100644 --- a/radio/src/gui/Taranis/menu_model_setup.cpp +++ b/radio/src/gui/Taranis/menu_model_setup.cpp @@ -43,13 +43,13 @@ enum menuModelSetupItems { ITEM_MODEL_BITMAP, ITEM_MODEL_TIMER1, ITEM_MODEL_TIMER1_NAME, - CASE_PERSISTENT_TIMERS(ITEM_MODEL_TIMER1_PERSISTENT) + ITEM_MODEL_TIMER1_PERSISTENT, ITEM_MODEL_TIMER1_MINUTE_BEEP, ITEM_MODEL_TIMER1_COUNTDOWN_BEEP, #if TIMERS > 1 ITEM_MODEL_TIMER2, ITEM_MODEL_TIMER2_NAME, - CASE_PERSISTENT_TIMERS(ITEM_MODEL_TIMER2_PERSISTENT) + ITEM_MODEL_TIMER2_PERSISTENT, ITEM_MODEL_TIMER2_MINUTE_BEEP, ITEM_MODEL_TIMER2_COUNTDOWN_BEEP, #endif diff --git a/radio/src/gui/Taranis/view_main.cpp b/radio/src/gui/Taranis/view_main.cpp index 9f0ae1d9c..11577538b 100755 --- a/radio/src/gui/Taranis/view_main.cpp +++ b/radio/src/gui/Taranis/view_main.cpp @@ -446,7 +446,7 @@ bool isMenuAvailable(int index) } } -#define GRAPHICAL_MENUS 1 +#define GRAPHICAL_MENUS 0 #if GRAPHICAL_MENUS == 1 #define DECLARE_MAIN_MENU() static int currentMenuIndex = -1 diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index 01b264c3b..039e71948 100644 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -63,20 +63,11 @@ int16_t ex_chans[NUM_CHNOUT] = {0}; // Outputs (before LIMITS) of the last perMa #if defined(HELI) int16_t cyc_anas[3] = {0}; - #if defined(PCBTARANIS) - int16_t heliAnas[4] = {0}; - int8_t heliTrims[4] = {0}; - #endif #endif void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) { -#if defined(PCBTARANIS) -#if defined(HELI) - int16_t heliAnasCopy[4]; - memcpy(heliAnasCopy, heliAnas, sizeof(heliAnasCopy)); -#endif -#else +#if !defined(PCBTARANIS) int16_t anas2[NUM_INPUTS]; // values before expo, to ensure same expo base when multiple expo lines are used memcpy(anas2, anas, sizeof(anas2)); #endif @@ -96,14 +87,9 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) if (getSwitch(ed->swtch)) { #if defined(PCBTARANIS) int v; - if (ed->srcRaw == ovwrIdx) + if (ed->srcRaw == ovwrIdx) { v = ovwrValue; -#if defined(HELI) - else if (ed->srcRaw == MIXSRC_Ele) - v = heliAnasCopy[ELE_STICK]; - else if (ed->srcRaw == MIXSRC_Ail) - v = heliAnasCopy[AIL_STICK]; -#endif + } else { v = getValue(ed->srcRaw); if (ed->srcRaw >= MIXSRC_FIRST_TELEM && ed->scale > 0) { @@ -152,17 +138,6 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) virtualInputsTrims[cur_chn] = ed->srcRaw - MIXSRC_Rud; else virtualInputsTrims[cur_chn] = -1; - -#if defined(HELI) - if (ed->srcRaw == MIXSRC_Ele) { - heliAnas[ELE_STICK] = v; - heliTrims[ELE_STICK] = virtualInputsTrims[cur_chn]; - } - else if (ed->srcRaw == MIXSRC_Ail) { - heliAnas[AIL_STICK] = v; - heliTrims[AIL_STICK] = virtualInputsTrims[cur_chn]; - } -#endif #endif anas[cur_chn] = v; @@ -426,7 +401,13 @@ void evalInputs(uint8_t mode) #if defined(HELI) uint16_t d = 0; if (g_model.swashR.value) { +#if defined(PCBTARANIS) + int ele = (int16_t)anaIn(ELE_STICK); + int ail = (int16_t)anaIn(AIL_STICK); + uint32_t v = (ele*ele) + (ail*ail); +#else uint32_t v = (int32_t(calibratedStick[ELE_STICK])*calibratedStick[ELE_STICK] + int32_t(calibratedStick[AIL_STICK])*calibratedStick[AIL_STICK]); +#endif uint32_t q = calc100toRESX(g_model.swashR.value); q *= q; if (v > q) { @@ -514,7 +495,7 @@ void evalInputs(uint8_t mode) if (ch < NUM_STICKS) { //only do this for sticks #if defined(PCBTARANIS) if (mode & e_perout_mode_nosticks) { - v = calibratedStick[ch] = 0; + v = 0; } #endif @@ -536,9 +517,6 @@ void evalInputs(uint8_t mode) v = vStud; break; } -#if defined(PCBTARANIS) - calibratedStick[ch] = v; -#endif } } @@ -546,12 +524,11 @@ void evalInputs(uint8_t mode) if (d && (ch==ELE_STICK || ch==AIL_STICK)) { v = (int32_t(v) * calc100toRESX(g_model.swashR.value)) / int32_t(d); } -#if defined(PCBTARANIS) - heliAnas[ch] = v; -#endif #endif -#if !defined(PCBTARANIS) +#if defined(PCBTARANIS) + calibratedStick[ch] = v; +#else rawAnas[ch] = v; anas[ch] = v; // set values for mixer #endif @@ -567,18 +544,38 @@ void evalInputs(uint8_t mode) if (mode == e_perout_mode_normal) { #if !defined(CPUARM) anaCenter &= g_model.beepANACenter; - if(((bpanaCenter ^ anaCenter) & anaCenter)) AUDIO_POT_MIDDLE(); + if (((bpanaCenter ^ anaCenter) & anaCenter)) AUDIO_POT_MIDDLE(); #endif bpanaCenter = anaCenter; } } #if defined(PCBTARANIS) - #define HELI_ANAS_ARRAY(x) heliAnas[x] - #define HELI_TRIMS_ARRAY(x) ((heliTrims[x]>=0) ? trims[heliTrims[x]] : 0) -#else - #define HELI_ANAS_ARRAY(x) anas[x] - #define HELI_TRIMS_ARRAY(x) trims[x] +int getStickTrimValue(int stick) +{ + int trim = trims[stick]; + if (stick == THR_STICK) { + if (g_model.thrTrim) { + int trimMin = g_model.extendedTrims ? 2*TRIM_EXTENDED_MIN : 2*TRIM_MIN; + int v = calibratedStick[THR_STICK]; + trim = (((g_model.throttleReversed)?(trim+trimMin):(trim-v)) * (RESX-v)) >> (RESX_SHIFT+1); + } + if (g_model.throttleReversed) { + trim = -trim; + } + } + return trim; +} + +int getSourceTrimValue(int source) +{ + if (source >= MIXSRC_Rud && source <= MIXSRC_Ail) + return getStickTrimValue(source - MIXSRC_Rud); + else if (source >= MIXSRC_FIRST_INPUT && source <= MIXSRC_LAST_INPUT) + return getStickTrimValue(virtualInputsTrims[source - MIXSRC_FIRST_INPUT]); + else + return 0; +} #endif uint8_t mixerCurrentFlightMode; @@ -593,15 +590,22 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms) #endif #if defined(HELI) +#if defined(PCBTARANIS) + int heliEleValue = getValue(g_model.swashR.elevatorSource); + int heliAilValue = getValue(g_model.swashR.aileronSource); +#else + int16_t heliEleValue = anas[ELE_STICK]; + int16_t heliAilValue = anas[AIL_STICK]; +#endif if (g_model.swashR.value) { - uint32_t v = ((int32_t)HELI_ANAS_ARRAY(ELE_STICK)*HELI_ANAS_ARRAY(ELE_STICK) + (int32_t)HELI_ANAS_ARRAY(AIL_STICK)*HELI_ANAS_ARRAY(AIL_STICK)); + uint32_t v = ((int32_t)heliEleValue*heliEleValue + (int32_t)heliAilValue*heliAilValue); uint32_t q = calc100toRESX(g_model.swashR.value); q *= q; if (v>q) { uint16_t d = isqrt32(v); int16_t tmp = calc100toRESX(g_model.swashR.value); - HELI_ANAS_ARRAY(ELE_STICK) = (int32_t) HELI_ANAS_ARRAY(ELE_STICK)*tmp/d; - HELI_ANAS_ARRAY(AIL_STICK) = (int32_t) HELI_ANAS_ARRAY(AIL_STICK)*tmp/d; + heliEleValue = (int32_t) heliEleValue*tmp/d; + heliAilValue = (int32_t) heliAilValue*tmp/d; } } @@ -609,8 +613,13 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms) #define REZ_SWASH_Y(x) ((x)) // 1024 => 1024 if (g_model.swashR.type) { - getvalue_t vp = HELI_ANAS_ARRAY(ELE_STICK) + HELI_TRIMS_ARRAY(ELE_STICK); - getvalue_t vr = HELI_ANAS_ARRAY(AIL_STICK) + HELI_TRIMS_ARRAY(AIL_STICK); +#if defined(PCBTARANIS) + getvalue_t vp = heliEleValue + getSourceTrimValue(g_model.swashR.elevatorSource); + getvalue_t vr = heliAilValue + getSourceTrimValue(g_model.swashR.aileronSource); +#else + getvalue_t vp = heliEleValue + trims[ELE_STICK]; + getvalue_t vr = heliAilValue + trims[AIL_STICK]; +#endif getvalue_t vc = 0; if (g_model.swashR.collectiveSource) vc = getValue(g_model.swashR.collectiveSource); @@ -797,26 +806,7 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms) if (!(mode & e_perout_mode_notrims)) { #if defined(PCBTARANIS) if (md->carryTrim == 0) { - int8_t mix_trim; - if (stickIndex < NUM_STICKS) - mix_trim = stickIndex; - else if (md->srcRaw <= MIXSRC_LAST_INPUT) - mix_trim = virtualInputsTrims[md->srcRaw-1]; - else - mix_trim = -1; - if (mix_trim >= 0) { - int32_t trim = trims[mix_trim]; - if (mix_trim == THR_STICK) { - if (g_model.thrTrim) { - int16_t trimMin = g_model.extendedTrims ? 2*TRIM_EXTENDED_MIN : 2*TRIM_MIN; - trim = (((g_model.throttleReversed)?(trim+trimMin):(trim-trimMin)) * (RESX-v)) >> (RESX_SHIFT+1); - } - if (g_model.throttleReversed) { - trim = -trim; - } - } - v += trim; - } + v += getSourceTrimValue(md->srcRaw); } #else int8_t mix_trim = md->carryTrim; diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index b78ab5803..669ee3144 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -1502,7 +1502,19 @@ enum SwashType { SWASH_TYPE_MAX = SWASH_TYPE_90 }; -PACK(typedef struct t_SwashRingData { // Swash Ring data +#if defined(PCBTARANIS) +PACK(typedef struct { + uint8_t invertELE:1; + uint8_t invertAIL:1; + uint8_t invertCOL:1; + uint8_t type:5; + uint8_t collectiveSource; + uint8_t aileronSource; + uint8_t elevatorSource; + uint8_t value; +}) SwashRingData; +#else +PACK(typedef struct { uint8_t invertELE:1; uint8_t invertAIL:1; uint8_t invertCOL:1; @@ -1510,6 +1522,7 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data uint8_t collectiveSource; uint8_t value; }) SwashRingData; +#endif #define TRIM_EXTENDED_MAX 500 #define TRIM_EXTENDED_MIN (-TRIM_EXTENDED_MAX) @@ -1673,7 +1686,7 @@ enum SwitchSources { SWSRC_LAST_SWITCH = SWSRC_TRN, #endif -#if defined(PCBTARANIS) +#if NUM_XPOTS > 0 SWSRC_FIRST_MULTIPOS_SWITCH, SWSRC_LAST_MULTIPOS_SWITCH = SWSRC_FIRST_MULTIPOS_SWITCH + (NUM_XPOTS*XPOTS_MULTIPOS_COUNT) - 1, #endif diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index f652b3a65..e61e6eabb 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -155,7 +155,9 @@ const pm_char STR_DEFAULT[] PROGMEM = TR_DEFAULT; const pm_char STR_CHECKTRIMS[] PROGMEM = TR_CHECKTRIMS; #ifdef HELI const pm_char STR_SWASHTYPE[] PROGMEM = TR_SWASHTYPE; -const pm_char STR_COLLECTIVE[] PROGMEM = TR_COLLECTIVE; +const pm_char STR_COLLECTIVE_SOURCE[] PROGMEM = TR_COLLECTIVE_SOURCE; +const pm_char STR_AILERON_SOURCE[] PROGMEM = TR_AILERON_SOURCE; +const pm_char STR_ELEVATOR_SOURCE[] PROGMEM = TR_ELEVATOR_SOURCE; const pm_char STR_SWASHRING[] PROGMEM = TR_SWASHRING; const pm_char STR_ELEDIRECTION[] PROGMEM = TR_ELEDIRECTION; const pm_char STR_AILDIRECTION[] PROGMEM = TR_AILDIRECTION; diff --git a/radio/src/translations.h b/radio/src/translations.h index e4ca9ec85..cb868718e 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -333,7 +333,9 @@ extern const pm_char STR_FADEOUT[]; extern const pm_char STR_DEFAULT[]; extern const pm_char STR_CHECKTRIMS[]; extern const pm_char STR_SWASHTYPE[]; -extern const pm_char STR_COLLECTIVE[]; +extern const pm_char STR_COLLECTIVE_SOURCE[]; +extern const pm_char STR_AILERON_SOURCE[]; +extern const pm_char STR_ELEVATOR_SOURCE[]; extern const pm_char STR_SWASHRING[]; extern const pm_char STR_ELEDIRECTION[]; extern const pm_char STR_AILDIRECTION[]; diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 963ff6d2a..819beee60 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -547,7 +547,9 @@ #define TR_CHECKTRIMS "\011Kont.\010Trimy" #define OFS_CHECKTRIMS (9*FW) #define TR_SWASHTYPE "Typ cykliky" -#define TR_COLLECTIVE "Kolektiv" +#define TR_COLLECTIVE_SOURCE "Kolektiv" +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Cyklika" #define TR_ELEDIRECTION "Směr:Výškovka" #define TR_AILDIRECTION "\012Křidélka" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 41ea2d44c..d7c1777a7 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -551,7 +551,9 @@ #define TR_CHECKTRIMS CENTER"\006Trims\012Prüfen" #define OFS_CHECKTRIMS CENTER_OFS+(9*FW) #define TR_SWASHTYPE TR("Typ Taumelsch","Typ Taumelscheibe") -#define TR_COLLECTIVE TR("Kollekt. Pitch","Kollekt. Pitch Kanal") +#define TR_COLLECTIVE_SOURCE TR("Kollekt. Pitch","Kollekt. Pitch Kanal") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING TR("Ring Begrenz","Ring Taumelscheibe") #define TR_ELEDIRECTION TR("Nick Richtung","Nick Servo Richtung") #define TR_AILDIRECTION TR("Roll Richtung","Roll Servo Richtung") diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index d4cd9d818..feb87cf1c 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -174,7 +174,7 @@ #define LEN_VMIXTRIMS "\003" #define TR_VMIXTRIMS "OFF""ON\0""Rud""Ele""Thr""Ail" -#if defined(PCBTARANIS) +#if LCD_W >= 212 #define TR_CSWTIMER "Timer" #define TR_CSWSTICKY "Stcky" #define TR_CSWRANGE "Range" @@ -298,7 +298,7 @@ #define TR_FSW_RESET_ROTENC #endif -#if defined(PCBTARANIS) +#if LCD_W >= 212 #define TR_FSW_RESET_TIMERS "Timer 1\0 ""Timer 2\0 ""Timer 3\0 " #elif defined(CPUARM) #define TR_FSW_RESET_TIMERS "Tmr1""Tmr2""Tmr3" @@ -331,7 +331,7 @@ #define TR_ASPD_MAX TR("ASp+", "ASpd+") -#if defined(PCBTARANIS) +#if LCD_W >= 212 #define TR_TELEM_RSSI_RX "RSSI\0" #else #define TR_TELEM_RSSI_RX TR("Rx\0 ", "Rx\0 ") @@ -472,9 +472,9 @@ #if defined(PCBTARANIS) #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #endif #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" #else @@ -519,10 +519,12 @@ #define INDENT "\007" #define LEN_INDENT 1 #define INDENT_WIDTH 12 + #define BREAKSPACE "\036" #else #define INDENT "\001" #define LEN_INDENT 1 #define INDENT_WIDTH (FW/2) + #define BREAKSPACE " " #endif #if defined(PCBTARANIS) @@ -542,7 +544,7 @@ #define TR_MENUWHENDONE CENTER "\006" TR_ENTER " WHEN DONE" #define TR_FREE "free" -#define TR_DELETEMODEL "DELETE MODEL" +#define TR_DELETEMODEL "DELETE" BREAKSPACE "MODEL" #define TR_COPYINGMODEL "Copying model..." #define TR_MOVINGMODEL "Moving model..." #define TR_LOADINGMODEL "Loading model..." @@ -551,7 +553,7 @@ #define TR_PHASENAME "Mode Name" #define TR_MIXNAME "Mix Name" #define TR_INPUTNAME "Input Name" -#if defined(PCBTARANIS) +#if defined(VIRTUALINPUTS) #define TR_EXPONAME "Line Name" #else #define TR_EXPONAME "Expo Name" @@ -579,7 +581,9 @@ #define TR_CHECKTRIMS CENTER "\006Check\012Trims" #define OFS_CHECKTRIMS CENTER_OFS+(9*FW) #define TR_SWASHTYPE "Swash Type" -#define TR_COLLECTIVE TR("Collective","Collective source") +#define TR_COLLECTIVE_SOURCE TR("Collective", "Collective source") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Swash Ring" #define TR_ELEDIRECTION TR("ELE Direction","Long. cyc. direction") #define TR_AILDIRECTION TR("AIL Direction","Lateral cyc. direction") @@ -792,10 +796,10 @@ #define TR_DELAY "Delay" #define TR_SD_CARD "SD CARD" #define TR_SDHC_CARD "SD-HC CARD" -#define TR_NO_SOUNDS_ON_SD "No Sounds on SD" -#define TR_NO_MODELS_ON_SD "No Models on SD" -#define TR_NO_BITMAPS_ON_SD "No Bitmaps on SD" -#define TR_NO_SCRIPTS_ON_SD "No Scripts on SD" +#define TR_NO_SOUNDS_ON_SD "No Sounds" BREAKSPACE "on SD" +#define TR_NO_MODELS_ON_SD "No Models" BREAKSPACE "on SD" +#define TR_NO_BITMAPS_ON_SD "No Bitmaps" BREAKSPACE "on SD" +#define TR_NO_SCRIPTS_ON_SD "No Scripts" BREAKSPACE "on SD" #define TR_PLAY_FILE "Play" #define TR_DELETE_FILE "Delete" #define TR_COPY_FILE "Copy" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index e815c468b..ae1e9abba 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -544,7 +544,9 @@ #define TR_CHECKTRIMS CENTER "\006Check\012Trims" #define OFS_CHECKTRIMS CENTER_OFS+(9*FW) #define TR_SWASHTYPE "Tipo ciclico" -#define TR_COLLECTIVE TR("Colectivo","Fuente Colectivo") +#define TR_COLLECTIVE_SOURCE TR("Colectivo", "Fuente Colectivo") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Ciclico" #define TR_ELEDIRECTION TR("ELE Direccion","Largo cyc. direccion") #define TR_AILDIRECTION TR("AIL Direccion","Lateral cyc. direccion") diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 7d77e8d94..365f55654 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -1,4 +1,4 @@ -/* +/* * Authors (alphabetical order) * - Bertrand Songis * - Bernet Andre @@ -544,7 +544,9 @@ #define TR_CHECKTRIMS CENTER "\006Check\012Trims" #define OFS_CHECKTRIMS CENTER_OFS+(9*FW) #define TR_SWASHTYPE "Swash Type" -#define TR_COLLECTIVE TR("Collective","Collective source") +#define TR_COLLECTIVE_SOURCE TR("Collective","Collective source") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Swash Ring" #define TR_ELEDIRECTION TR("ELE Direction","Long. cyc. direction") #define TR_AILDIRECTION TR("AIL Direction","Lateral cyc. direction") diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 03a2c1d08..2c19071fa 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -1,4 +1,4 @@ -/* +/* * Authors (alphabetical order) * - Andre Bernet * - Bertrand Songis @@ -544,7 +544,9 @@ #define TR_CHECKTRIMS "\006Vérif\012Trims" #define OFS_CHECKTRIMS (9*FW) #define TR_SWASHTYPE TR("Type de Plat.", "Type de plateau") -#define TR_COLLECTIVE TR("Collectif", "Voie du pas collectif") +#define TR_COLLECTIVE_SOURCE TR("Collectif", "Voie du pas collectif") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING TR("Limite Cycl.", "Limite du cyclique") #define TR_ELEDIRECTION TR("Inv. longitud.", "Inversion longitudinal") #define TR_AILDIRECTION TR("Inv. latéral", "Inversion latéral") diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index bfefb8543..d6ebc2750 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -544,7 +544,9 @@ #define TR_CHECKTRIMS "\003Contr.\004Trim" #define OFS_CHECKTRIMS (9*FW) #define TR_SWASHTYPE "Tipo Ciclico" -#define TR_COLLECTIVE TR("Collettivo","Origine Collettivo") +#define TR_COLLECTIVE_SOURCE TR("Collettivo","Origine Collettivo") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Anello Ciclico" #define TR_ELEDIRECTION TR("Direzione ELE","Direzione Long. cyc.") #define TR_AILDIRECTION TR("Direzione AIL","Direzione Lateral cyc.") diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 615e346dd..3fbf0646a 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -542,7 +542,9 @@ #define TR_CHECKTRIMS CENTER "\006Spr \012Trymy" #define OFS_CHECKTRIMS CENTER_OFS+(9*FW) #define TR_SWASHTYPE "Typ tarczy" -#define TR_COLLECTIVE TR("Kolektyw ","Źródło Kolektywu ") +#define TR_COLLECTIVE_SOURCE TR("Kolektyw", "Źródło Kolektywu") +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Tarcza " #define TR_ELEDIRECTION TR("Ster Wysokośc","Dług. Kierunku cyklu") #define TR_AILDIRECTION TR("Kierunek Lotk","Lateral cyc. direction") diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index cc3a7b015..74103dc7f 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -544,7 +544,9 @@ #define TR_CHECKTRIMS "\006Check\012Trims" #define OFS_CHECKTRIMS (9*FW) #define TR_SWASHTYPE "Ciclico Tipo" -#define TR_COLLECTIVE "Coletivo" +#define TR_COLLECTIVE_SOURCE "Coletivo" +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Anel Coletivo" #define TR_ELEDIRECTION "PFD Sentido" #define TR_AILDIRECTION "AIL Sentido" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 1993d3663..8cbe43b3e 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -544,7 +544,9 @@ #define TR_CHECKTRIMS CENTER "\006Kolla\012Trimmar" #define OFS_CHECKTRIMS CENTER_OFS+(9*FW) #define TR_SWASHTYPE "Swashtyp" -#define TR_COLLECTIVE "Kollektiv" +#define TR_COLLECTIVE_SOURCE "Kollektiv" +#define TR_AILERON_SOURCE "Aileron Source" +#define TR_ELEVATOR_SOURCE "Elevator Source" #define TR_SWASHRING "Swashring" #define TR_ELEDIRECTION "HöJD Riktning" #define TR_AILDIRECTION "SKEV Riktning"