1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 17:55:19 +03:00

Fix multi failsafe been inverted between hold and no pulse (#6815)

This commit is contained in:
3djc 2019-09-23 10:12:58 +02:00 committed by Bertrand Songis
parent 3b171ca3aa
commit 7478358e86

View file

@ -59,18 +59,13 @@ static void sendFailsafeChannels(uint8_t port)
for (int i = 0; i < MULTI_CHANS; i++) {
int16_t failsafeValue = g_model.failsafeChannels[i];
int pulseValue;
if (g_model.moduleData[port].failsafeMode == FAILSAFE_HOLD)
failsafeValue = FAILSAFE_CHANNEL_HOLD;
if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES)
failsafeValue = FAILSAFE_CHANNEL_NOPULSE;
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
pulseValue = 0;
}
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
if (g_model.moduleData[port].failsafeMode == FAILSAFE_HOLD) {
pulseValue = 2047;
}
else if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES) {
pulseValue = 0;
}
else {
failsafeValue += 2 * PPM_CH_CENTER(g_model.moduleData[port].channelsStart + i) - 2 * PPM_CENTER;
pulseValue = limit(1, (failsafeValue * 800 / 1000) + 1024, 2047);