1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

When FEATURE_FAILSAFE is not enabled, always read the channels from the

s.bus rx (otherwise rx failsafe will not work)
This commit is contained in:
Mikael Blomqvist 2014-05-04 22:20:25 +02:00
parent c1fcdabdc1
commit 69f420ca3e

View file

@ -81,8 +81,14 @@ static void sbusDataReceive(uint16_t c)
bool sbusFrameComplete(void)
{
if (sbusFrameDone) {
if (!((sbus.in[22] >> 3) & 0x0001)) { // failsave flag
if (!sbusFrameDone) {
return false;
}
sbusFrameDone = false;
if (feature(FEATURE_FAILSAFE) && ((sbus.in[22] >> 3) & 0x0001)) {
// internal failsafe enabled and rx failsafe flag set
return false;
}
failsafeCnt = 0; // clear FailSafe counter
sbusChannelData[0] = sbus.msg.chan0;
sbusChannelData[1] = sbus.msg.chan1;
@ -93,12 +99,7 @@ bool sbusFrameComplete(void)
sbusChannelData[6] = sbus.msg.chan6;
sbusChannelData[7] = sbus.msg.chan7;
// need more channels? No problem. Add them.
sbusFrameDone = false;
return true;
}
sbusFrameDone = false;
}
return false;
}
static uint16_t sbusReadRawRC(uint8_t chan)