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

Dangerous module functions fix

This commit is contained in:
bsongis 2015-05-11 20:34:24 +02:00
parent 54a5a34fe8
commit 0c17833ab7

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
}
}
}