Allow backlight function to turn off backlight entirely (#8005)

This commit is contained in:
3djc
2020-10-10 09:46:07 +02:00
committed by GitHub
parent b2a4cad572
commit a82ed914c9
+3
View File
@@ -358,6 +358,9 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
{ {
getvalue_t raw = getValue(CFN_PARAM(cfn)); getvalue_t raw = getValue(CFN_PARAM(cfn));
#if defined(COLORLCD) #if defined(COLORLCD)
if (raw == -1024)
requiredBacklightBright = 100;
else
requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048; requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048;
#else #else
requiredBacklightBright = (1024 - raw) * 100 / 2048; requiredBacklightBright = (1024 - raw) * 100 / 2048;