1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 17:55:30 +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) bool sbusFrameComplete(void)
{ {
if (sbusFrameDone) { if (!sbusFrameDone) {
if (!((sbus.in[22] >> 3) & 0x0001)) { // failsave flag 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 failsafeCnt = 0; // clear FailSafe counter
sbusChannelData[0] = sbus.msg.chan0; sbusChannelData[0] = sbus.msg.chan0;
sbusChannelData[1] = sbus.msg.chan1; sbusChannelData[1] = sbus.msg.chan1;
@ -93,13 +99,8 @@ bool sbusFrameComplete(void)
sbusChannelData[6] = sbus.msg.chan6; sbusChannelData[6] = sbus.msg.chan6;
sbusChannelData[7] = sbus.msg.chan7; sbusChannelData[7] = sbus.msg.chan7;
// need more channels? No problem. Add them. // need more channels? No problem. Add them.
sbusFrameDone = false;
return true; return true;
} }
sbusFrameDone = false;
}
return false;
}
static uint16_t sbusReadRawRC(uint8_t chan) static uint16_t sbusReadRawRC(uint8_t chan)
{ {