mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 09:45:37 +03:00
Use received Serial RX data even when serial rx reports failsafe.
This commit is contained in:
parent
94e499f9aa
commit
1c9ebf9437
2 changed files with 19 additions and 21 deletions
|
@ -294,12 +294,10 @@ void processRxChannels(void)
|
||||||
|
|
||||||
void processDataDrivenRx(void)
|
void processDataDrivenRx(void)
|
||||||
{
|
{
|
||||||
if (!rcDataReceived) {
|
if (rcDataReceived) {
|
||||||
return;
|
failsafe->vTable->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
failsafe->vTable->reset();
|
|
||||||
|
|
||||||
processRxChannels();
|
processRxChannels();
|
||||||
|
|
||||||
rcDataReceived = false;
|
rcDataReceived = false;
|
||||||
|
|
|
@ -176,25 +176,10 @@ bool sbusFrameComplete(void)
|
||||||
sbusFrameDone = false;
|
sbusFrameDone = false;
|
||||||
|
|
||||||
#ifdef DEBUG_SBUS_PACKETS
|
#ifdef DEBUG_SBUS_PACKETS
|
||||||
|
sbusStateFlags = 0;
|
||||||
debug[1] = sbusFrame.frame.flags;
|
debug[1] = sbusFrame.frame.flags;
|
||||||
#endif
|
#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[0] = sbusFrame.frame.chan0;
|
||||||
sbusChannelData[1] = sbusFrame.frame.chan1;
|
sbusChannelData[1] = sbusFrame.frame.chan1;
|
||||||
sbusChannelData[2] = sbusFrame.frame.chan2;
|
sbusChannelData[2] = sbusFrame.frame.chan2;
|
||||||
|
@ -224,8 +209,23 @@ bool sbusFrameComplete(void)
|
||||||
sbusChannelData[17] = SBUS_DIGITAL_CHANNEL_MIN;
|
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
|
#ifdef DEBUG_SBUS_PACKETS
|
||||||
sbusStateFlags = 0;
|
|
||||||
debug[0] = sbusStateFlags;
|
debug[0] = sbusStateFlags;
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue