From f3a75661d9d5f18d4cf1903ed3f33dd772758c50 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Jun 2024 18:55:00 +1000 Subject: [PATCH] AP_Frsky_Telem: avoid use if int16-t read call --- libraries/AP_Frsky_Telem/AP_Frsky_SPort.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Frsky_Telem/AP_Frsky_SPort.cpp b/libraries/AP_Frsky_Telem/AP_Frsky_SPort.cpp index c4dd68e481..ee22bc40de 100644 --- a/libraries/AP_Frsky_Telem/AP_Frsky_SPort.cpp +++ b/libraries/AP_Frsky_Telem/AP_Frsky_SPort.cpp @@ -43,7 +43,10 @@ void AP_Frsky_SPort::send(void) } for (int16_t i = 0; i < numc; i++) { - int16_t readbyte = _port->read(); + uint8_t readbyte; + if (!_port->read(readbyte)) { + break; + } if (_SPort.sport_status == false) { if (readbyte == FRAME_HEAD) { _SPort.sport_status = true;