Brightness adjust from backlight function (#7680)

Adjust brightness from backlight function
This commit is contained in:
DanielGeA
2020-07-31 17:06:11 +02:00
committed by GitHub
parent ac9f510005
commit 035cc6c031
16 changed files with 76 additions and 46 deletions
+10 -3
View File
@@ -340,7 +340,7 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
#if defined(VARIO)
case FUNC_VARIO:
newActiveFunctions |= (1 << FUNCTION_VARIO);
newActiveFunctions |= (1u << FUNCTION_VARIO);
break;
#endif
@@ -348,15 +348,22 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
#if defined(SDCARD)
case FUNC_LOGS:
if (CFN_PARAM(cfn)) {
newActiveFunctions |= (1 << FUNCTION_LOGS);
newActiveFunctions |= (1u << FUNCTION_LOGS);
logDelay = CFN_PARAM(cfn);
}
break;
#endif
case FUNC_BACKLIGHT:
newActiveFunctions |= (1 << FUNCTION_BACKLIGHT);
{
getvalue_t raw = getValue(CFN_PARAM(cfn));
#if defined(COLORLCD)
requiredBacklightBright = (1024 - raw) * (BACKLIGHT_LEVEL_MAX - BACKLIGHT_LEVEL_MIN) / 2048;
#else
requiredBacklightBright = (1024 - raw) * 100 / 2048;
#endif
break;
}
case FUNC_SCREENSHOT:
if (!(functionsContext.activeSwitches & switch_mask)) {