Fix SBUS trainer failsafe detection

This commit is contained in:
Andre Bernet
2015-08-01 17:48:02 +02:00
parent eedaf1966e
commit a1bc46e473
+2 -3
View File
@@ -69,9 +69,8 @@ void processSbusFrame(uint8_t *sbus, int16_t *pulses, uint32_t size)
return;
}
if (size > SBUS_FLAGS_IDX &&
(sbus[SBUS_FLAGS_IDX-1] & (1<<SBUS_FAILSAFE_BIT))) {
return; // SBUS failsafe mode
if (size > SBUS_FLAGS_IDX && ((sbus[SBUS_FLAGS_IDX] & (1<<SBUS_FAILSAFE_BIT)) || (sbus[SBUS_FLAGS_IDX] & (1<<SBUS_FRAMELOST_BIT)))) {
return; // SBUS invalid frame or failsafe mode
}
// Skip start byte