Skip to content

Commit

Permalink
Disable source 'Invert' option for 'Play Value' SF/GF.
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed Mar 4, 2025
1 parent a220ea3 commit f04c93b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion radio/src/gui/128x64/model_special_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
val_max = MIXSRC_LAST_TELEM;
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN - (val_displayed == 0 ? 0 : 2 * FW), y, val_displayed, attr);
if (active) {
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE | INCDEC_SOURCE_INVERT);
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
}
}
Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/212x64/model_special_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
val_max = MIXSRC_LAST_TELEM;
drawSource(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr);
if (active) {
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE | INCDEC_SOURCE_INVERT);
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
}
}
Expand Down
6 changes: 3 additions & 3 deletions radio/src/gui/colorlcd/model/special_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ void FunctionEditPage::buildHeader(Window *window, const char *title,
}

void FunctionEditPage::addSourceChoice(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmax)
CustomFunctionData *cfn, int16_t vmax, bool allowInvert)
{
new StaticText(line, rect_t{}, title);
new SourceChoice(line, rect_t{}, 0, vmax, GET_SET_DEFAULT(CFN_PARAM(cfn)), true);
new SourceChoice(line, rect_t{}, 0, vmax, GET_SET_DEFAULT(CFN_PARAM(cfn)), allowInvert);
}

NumberEdit *FunctionEditPage::addNumberEdit(FormLine *line, const char *title,
Expand Down Expand Up @@ -486,7 +486,7 @@ void FunctionEditPage::updateSpecialFunctionOneWindow()
break;

case FUNC_PLAY_VALUE:
addSourceChoice(line, STR_VALUE, cfn, MIXSRC_LAST_TELEM);
addSourceChoice(line, STR_VALUE, cfn, MIXSRC_LAST_TELEM, false);
break;

case FUNC_HAPTIC:
Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/colorlcd/model/special_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class FunctionEditPage : public Page
void buildHeader(Window *window, const char *title, const char *prefix);

void addSourceChoice(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmax);
CustomFunctionData *cfn, int16_t vmax, bool allowInvert = true);

NumberEdit *addNumberEdit(FormLine *line, const char *title,
CustomFunctionData *cfn, int16_t vmin, int16_t vmax);
Expand Down

0 comments on commit f04c93b

Please sign in to comment.