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

Fixes #2266 - SetFailsafe Custom Function. Version without an EEPROM

shift. It removes the ModuleOff function which nobody will need I hope
...
This commit is contained in:
bsongis 2015-05-11 06:49:45 +02:00
parent dab2267e10
commit 55356baea8
18 changed files with 35 additions and 20 deletions

View file

@ -371,10 +371,26 @@ void evalFunctions()
}
#endif
#if defined(CPUARM)
case FUNC_SET_FAILSAFE:
{
unsigned int moduleIndex = CFN_PARAM(cfn);
if (moduleIndex < NUM_MODULES) {
for (int ch=0; ch<NUM_CHNOUT; ch++) {
if (ch < g_model.moduleData[moduleIndex].channelsStart || ch >= NUM_CHANNELS(moduleIndex) + g_model.moduleData[moduleIndex].channelsStart) {
g_model.moduleData[moduleIndex].failsafeChannels[ch] = 0;
}
else if (g_model.moduleData[moduleIndex].failsafeChannels[ch] < FAILSAFE_CHANNEL_HOLD) {
g_model.moduleData[moduleIndex].failsafeChannels[ch] = channelOutputs[ch];
}
}
}
}
#endif
#if defined(DANGEROUS_MODULE_FUNCTIONS)
case FUNC_RANGECHECK:
case FUNC_BIND:
case FUNC_MODULE_OFF:
{
unsigned int moduleIndex = CFN_PARAM(cfn);
if (moduleIndex < NUM_MODULES) {