From b644dfebc4a9df9d4c0aba67da326da7b0c9d5df Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 21 Feb 2023 20:35:57 +1100 Subject: [PATCH] AP_Mount: add and use a "bool read(c)" method to AP_HAL this is much less likely to not work vs the int16_t equivalent --- libraries/AP_Mount/AP_Mount_Siyi.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount_Siyi.cpp b/libraries/AP_Mount/AP_Mount_Siyi.cpp index 6e62ac96d3..1a7a2aaa0b 100644 --- a/libraries/AP_Mount/AP_Mount_Siyi.cpp +++ b/libraries/AP_Mount/AP_Mount_Siyi.cpp @@ -177,10 +177,8 @@ void AP_Mount_Siyi::read_incoming_packets() // process bytes received for (int16_t i = 0; i < nbytes; i++) { - const int16_t b = _uart->read(); - - // sanity check byte - if ((b < 0) || (b > 0xFF)) { + uint8_t b; + if (!_uart->read(b)) { continue; }