fix(firmware): global variable value and range may not be correct (#7009)

This commit is contained in:
philmoz
2026-01-25 13:43:02 +10:00
committed by GitHub
parent 06509ac5ca
commit 61ce1a2d18
9 changed files with 74 additions and 19 deletions
@@ -173,9 +173,7 @@ void menuModelLogicalSwitches(event_t event)
INCDEC_ENABLE_CHECK(nullptr);
}
LcdFlags lf = attr2 | LEFT;
getMixSrcRange(v1_val, v2_min, v2_max, &lf);
if ((cs->func == LS_FUNC_APOS) || (cs->func == LS_FUNC_ANEG) || (cs->func == LS_FUNC_ADIFFEGREATER))
v2_min = 0;
if (validateLSV2Range(cs, v2_min, v2_max, &lf)) storageDirty(EE_MODEL);
drawSourceCustomValue(CSW_3RD_COLUMN, y, v1_val, (abs(v1_val) <= MIXSRC_LAST_CH ? calc100toRESX(cs->v2) : cs->v2), lf);
}
@@ -249,6 +249,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
}
#if defined(GVARS)
else if (func == FUNC_ADJUST_GVAR) {
if (validateSFGV(cfn)) storageDirty(eeFlags);
maxParam = MAX_GVARS-1;
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);