2.4 continued (#8092)

Quite a bit of work on 2.4

Co-authored-by: 3djc <Th1sisfmyofmyo>
This commit is contained in:
3djc
2020-11-14 14:55:37 +04:00
committed by GitHub
co-authored by 3djc <Th1sisfmyofmyo>
parent cd6aa7af00
commit 87cd9047b1
238 changed files with 5164 additions and 2755 deletions
+10 -1
View File
@@ -359,9 +359,18 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
case FUNC_BACKLIGHT:
{
newActiveFunctions |= (1u << FUNCTION_BACKLIGHT);
if (!CFN_PARAM(cfn)) { // When no source is set, backlight works like original backlight and turn on regardless of backlight settings
requiredBacklightBright = BACKLIGHT_FORCED_ON;
break;
}
getvalue_t raw = getValue(CFN_PARAM(cfn));
#if defined(COLORLCD)
requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048;
if (raw == -1024)
requiredBacklightBright = 100;
else
requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048;
#else
requiredBacklightBright = (1024 - raw) * 100 / 2048;
#endif