mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 07:45:14 +03:00
Merge pull request #2297 from opentx/bsongis/dangerous_module_functions
Dangerous module functions fix
This commit is contained in:
commit
dab2267e10
1 changed files with 17 additions and 1 deletions
|
@ -371,7 +371,7 @@ void evalFunctions()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0 //defined(DANGEROUS_MODULE_FUNCTIONS)
|
#if defined(DANGEROUS_MODULE_FUNCTIONS)
|
||||||
case FUNC_RANGECHECK:
|
case FUNC_RANGECHECK:
|
||||||
case FUNC_BIND:
|
case FUNC_BIND:
|
||||||
case FUNC_MODULE_OFF:
|
case FUNC_MODULE_OFF:
|
||||||
|
@ -568,6 +568,22 @@ void evalFunctions()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
functionsContext.lastFunctionTime[i] = 0;
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue