Skip to content

Commit 5a0c8db

Browse files
authored
fix(radio): constrain Backlight SF input value to valid range (#6009)
1 parent 62a935b commit 5a0c8db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

radio/src/functions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ void evalFunctions(CustomFunctionData * functions, CustomFunctionsContext & func
406406
break;
407407
}
408408

409-
getvalue_t raw = getValue(CFN_PARAM(cfn));
409+
getvalue_t raw = limit(-RESX, (int)getValue(CFN_PARAM(cfn)), RESX);
410410
#if defined(COLORLCD)
411411
requiredBacklightBright = BACKLIGHT_LEVEL_MAX - (g_eeGeneral.blOffBright +
412412
((1024 + raw) * ((BACKLIGHT_LEVEL_MAX - g_eeGeneral.backlightBright) - g_eeGeneral.blOffBright) / 2048));

0 commit comments

Comments
 (0)