voxl2-slpi: Removed bogus protocol check in custom Spektrum RC driver

This commit is contained in:
Eric Katzfey
2025-03-05 13:44:37 -08:00
committed by Daniel Agar
parent 71554af8fa
commit 4184cf67d3
@@ -152,16 +152,11 @@ void task_main(int argc, char *argv[])
newbytes = read(uart_fd, &rx_buf[0], sizeof(rx_buf));
#endif
uint8_t protocol_version = rx_buf[1] & 0x0F;
if (newbytes <= 0) {
if (print_msg) { PX4_INFO("Spektrum RC: Read no bytes from UART"); }
} else if (((newbytes != DSM_FRAME_SIZE) ||
((protocol_version != 0x02) && (protocol_version != 0x01))) &&
(! first_correct_frame_received)) {
PX4_ERR("Spektrum RC: Invalid DSM frame. %d bytes. Protocol byte 0x%.2x",
newbytes, rx_buf[1]);
} else if ((newbytes != DSM_FRAME_SIZE) && (! first_correct_frame_received)) {
PX4_ERR("Invalid DSM frame size: %d bytes", newbytes);
} else {
if (print_msg) { PX4_INFO("Spektrum RC: Read %d bytes from UART", newbytes); }