From 4184cf67d3f2b3b957ff52df8af63368a7d8f1e5 Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Wed, 5 Mar 2025 13:44:37 -0800 Subject: [PATCH] voxl2-slpi: Removed bogus protocol check in custom Spektrum RC driver --- .../voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp b/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp index 18067b1756..3de4754c69 100644 --- a/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp +++ b/boards/modalai/voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp @@ -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); }