From 8d1dee44b874c91cbc58f3a8fe16c7abf06048a2 Mon Sep 17 00:00:00 2001 From: ben grocholsky Date: Fri, 13 Oct 2023 17:32:35 -0700 Subject: [PATCH] Change spectrum_rc to accept protocol bytes 0x01 or 0x02 and shorten 'no first frame' error message to print in fewer than 80 characters --- .../voxl2-slpi/src/drivers/spektrum_rc/spektrum_rc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 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 c2405de1fede..607fa10a4b60 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 @@ -153,8 +153,8 @@ void task_main(int argc, char *argv[]) if (newbytes <= 0) { if (print_msg) { PX4_INFO("Spektrum RC: Read no bytes from UART"); } - } else if (((newbytes != DSM_FRAME_SIZE) || ((rx_buf[1] & 0x0F) != 0x02)) && (! first_correct_frame_received)) { - PX4_ERR("Spektrum RC: Read something other than correct DSM frame on read. Got %d bytes. Protocol byte is 0x%.2x", + } else if (((newbytes != DSM_FRAME_SIZE) || (((rx_buf[1] & 0x0F) != 0x02) && ((rx_buf[1] & 0x0F) != 0x01))) && (! first_correct_frame_received)) { + PX4_ERR("Spektrum RC: Got %d bytes. Protocol byte is 0x%.2x. No 1st Frame!", newbytes, rx_buf[1]); } else {