diff --git a/radio/src/functions.cpp b/radio/src/functions.cpp index 0f93ca786..0d1ebbf38 100644 --- a/radio/src/functions.cpp +++ b/radio/src/functions.cpp @@ -169,14 +169,14 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext if (param == 0) newActiveFunctions |= 0x0F; else if (param <= NUM_STICKS) - newActiveFunctions |= (1 << (param-1)); + newActiveFunctions |= (1 << (param - 1)); else if (param == NUM_STICKS + 1) - newActiveFunctions |= (1 << FUNCTION_TRAINER_CHANNELS); + newActiveFunctions |= (1u << FUNCTION_TRAINER_CHANNELS); break; } case FUNC_INSTANT_TRIM: - newActiveFunctions |= (1 << FUNCTION_INSTANT_TRIM); + newActiveFunctions |= (1u << FUNCTION_INSTANT_TRIM); if (!isFunctionActive(FUNCTION_INSTANT_TRIM)) { if (IS_INSTANT_TRIM_ALLOWED()) { instantTrim(); diff --git a/radio/src/gui/128x64/model_special_functions.cpp b/radio/src/gui/128x64/model_special_functions.cpp index a0472d681..bfcee26c3 100644 --- a/radio/src/gui/128x64/model_special_functions.cpp +++ b/radio/src/gui/128x64/model_special_functions.cpp @@ -224,15 +224,17 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF if (func == FUNC_TRAINER) { maxParam = NUM_STICKS + 1; uint8_t param = CFN_CH_INDEX(cfn); - if (param == NUM_STICKS + 1) - lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, "Chans", attr); + if (param == 0) + lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_STICKS, attr); + else if (param == NUM_STICKS + 1) + lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_CHANS, attr); else - drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, CFN_CH_INDEX(cfn) == 0 ? 0 : MIXSRC_Rud + CFN_CH_INDEX(cfn) - 1, attr); + drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, MIXSRC_Rud + param - 1, attr); } #if defined(GVARS) else if (func == FUNC_ADJUST_GVAR) { maxParam = MAX_GVARS-1; - drawStringWithIndex(lcdNextPos, y, STR_GV, CFN_GVAR_INDEX(cfn)+1, attr); + drawStringWithIndex(lcdNextPos + 2, y, STR_GV, CFN_GVAR_INDEX(cfn)+1, attr); if (active) CFN_GVAR_INDEX(cfn) = checkIncDec(event, CFN_GVAR_INDEX(cfn), 0, maxParam, eeFlags); break; } diff --git a/radio/src/gui/212x64/model_special_functions.cpp b/radio/src/gui/212x64/model_special_functions.cpp index eb1bcb58d..7c2d1e139 100644 --- a/radio/src/gui/212x64/model_special_functions.cpp +++ b/radio/src/gui/212x64/model_special_functions.cpp @@ -216,15 +216,17 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF if (func == FUNC_TRAINER) { maxParam = NUM_STICKS + 1; uint8_t param = CFN_CH_INDEX(cfn); - if (param == NUM_STICKS + 1) - lcdDrawText(lcdNextPos, y, "Chans", attr); + if (param == 0) + lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_STICKS, attr); + else if (param == NUM_STICKS + 1) + lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_CHANS, attr); else - drawSource(lcdNextPos, y, CFN_CH_INDEX(cfn)==0 ? 0 : MIXSRC_Rud+CFN_CH_INDEX(cfn)-1, attr); + drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, MIXSRC_Rud + param - 1, attr); } #if defined(GVARS) else if (func == FUNC_ADJUST_GVAR) { maxParam = MAX_GVARS-1; - drawStringWithIndex(lcdNextPos, y, STR_GV, CFN_GVAR_INDEX(cfn)+1, attr); + drawStringWithIndex(lcdNextPos + 2, y, STR_GV, CFN_GVAR_INDEX(cfn)+1, attr); if (active) CFN_GVAR_INDEX(cfn) = checkIncDec(event, CFN_GVAR_INDEX(cfn), 0, maxParam, eeFlags); break; } diff --git a/radio/src/gui/480x272/model_special_functions.cpp b/radio/src/gui/480x272/model_special_functions.cpp index f646b027c..fdc063dc9 100644 --- a/radio/src/gui/480x272/model_special_functions.cpp +++ b/radio/src/gui/480x272/model_special_functions.cpp @@ -217,10 +217,12 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF if (func == FUNC_TRAINER) { maxParam = NUM_STICKS + 1; uint8_t param = CFN_CH_INDEX(cfn); - if (param == NUM_STICKS + 1) - lcdDrawText(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, "Chans", attr); + if (param == 0) + lcdDrawText(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, STR_STICKS, attr); + else if (param == NUM_STICKS + 1) + lcdDrawText(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, STR_CHANS, attr); else - drawSource(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, CFN_CH_INDEX(cfn)==0 ? 0 : MIXSRC_Rud+CFN_CH_INDEX(cfn)-1, attr); + drawSource(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, MIXSRC_Rud + param - 1, attr); } #if defined(GVARS) else if (func == FUNC_ADJUST_GVAR) { diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index 6d9d543cf..e4b701c9c 100644 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -232,7 +232,7 @@ int16_t applyLimits(uint8_t channel, int32_t value) #endif if (isFunctionActive(FUNCTION_TRAINER_CHANNELS) && IS_TRAINER_INPUT_VALID()) { - return ppmInput[channel]; + return ppmInput[channel] * 2; } LimitData * lim = limitAddress(channel); @@ -369,22 +369,22 @@ getvalue_t getValue(mixsrc_t i) #endif else if (i <= MIXSRC_LAST_LOGICAL_SWITCH) { - return getSwitch(SWSRC_FIRST_LOGICAL_SWITCH+i-MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024; + return getSwitch(SWSRC_FIRST_LOGICAL_SWITCH + i - MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024; } else if (i <= MIXSRC_LAST_TRAINER) { - int16_t x = ppmInput[i-MIXSRC_FIRST_TRAINER]; - if (i