Use received Serial RX data even when serial rx reports failsafe.

This commit is contained in:
Dominic Clifton 2015-03-03 23:17:25 +00:00
parent 94e499f9aa
commit 1c9ebf9437
2 changed files with 19 additions and 21 deletions

View File

@ -294,12 +294,10 @@ void processRxChannels(void)
void processDataDrivenRx(void)
{
if (!rcDataReceived) {
return;
if (rcDataReceived) {
failsafe->vTable->reset();
}
failsafe->vTable->reset();
processRxChannels();
rcDataReceived = false;

View File

@ -176,25 +176,10 @@ bool sbusFrameComplete(void)
sbusFrameDone = false;
#ifdef DEBUG_SBUS_PACKETS
sbusStateFlags = 0;
debug[1] = sbusFrame.frame.flags;
#endif
if (sbusFrame.frame.flags & SBUS_FLAG_SIGNAL_LOSS) {
// internal failsafe enabled and rx failsafe flag set
#ifdef DEBUG_SBUS_PACKETS
sbusStateFlags |= SBUS_STATE_SIGNALLOSS;
debug[0] |= SBUS_STATE_SIGNALLOSS;
#endif
}
if (sbusFrame.frame.flags & SBUS_FLAG_FAILSAFE_ACTIVE) {
#ifdef DEBUG_SBUS_PACKETS
sbusStateFlags |= SBUS_STATE_FAILSAFE;
debug[0] = sbusStateFlags;
#endif
// internal failsafe enabled and rx failsafe flag set
return false;
}
sbusChannelData[0] = sbusFrame.frame.chan0;
sbusChannelData[1] = sbusFrame.frame.chan1;
sbusChannelData[2] = sbusFrame.frame.chan2;
@ -224,8 +209,23 @@ bool sbusFrameComplete(void)
sbusChannelData[17] = SBUS_DIGITAL_CHANNEL_MIN;
}
if (sbusFrame.frame.flags & SBUS_FLAG_SIGNAL_LOSS) {
#ifdef DEBUG_SBUS_PACKETS
sbusStateFlags |= SBUS_STATE_SIGNALLOSS;
debug[0] = sbusStateFlags;
#endif
}
if (sbusFrame.frame.flags & SBUS_FLAG_FAILSAFE_ACTIVE) {
// internal failsafe enabled and rx failsafe flag set
#ifdef DEBUG_SBUS_PACKETS
sbusStateFlags |= SBUS_STATE_FAILSAFE;
debug[0] = sbusStateFlags;
#endif
// RX *should* still be sending valid channel data, so use it.
return false;
}
#ifdef DEBUG_SBUS_PACKETS
sbusStateFlags = 0;
debug[0] = sbusStateFlags;
#endif
return true;