1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-19 14:25:11 +03:00

Merge pull request #2297 from opentx/bsongis/dangerous_module_functions

Dangerous module functions fix
This commit is contained in:
Bertrand Songis 2015-06-28 20:53:16 +02:00
commit dab2267e10

View file

@ -371,7 +371,7 @@ void evalFunctions()
}
#endif
#if 0 //defined(DANGEROUS_MODULE_FUNCTIONS)
#if defined(DANGEROUS_MODULE_FUNCTIONS)
case FUNC_RANGECHECK:
case FUNC_BIND:
case FUNC_MODULE_OFF:
@ -568,6 +568,22 @@ void evalFunctions()
}
else {
functionsContext.lastFunctionTime[i] = 0;
#if defined(DANGEROUS_MODULE_FUNCTIONS)
if (functionsContext.activeSwitches & switch_mask)) {
switch (CFN_FUNC(cfn)) {
case FUNC_RANGECHECK:
case FUNC_BIND:
case FUNC_MODULE_OFF:
{
unsigned int moduleIndex = CFN_PARAM(cfn);
if (moduleIndex < NUM_MODULES) {
moduleFlag[moduleIndex] = 0;
}
break;
}
}
}
#endif
}
}
}