AP_ADSB: correct bad port read in Sagetech driver

This commit is contained in:
Peter Barker 2023-07-11 17:05:31 +10:00 committed by Andrew Tridgell
parent 2aa0d915f1
commit fbc66132e3
1 changed files with 2 additions and 2 deletions

View File

@ -69,8 +69,8 @@ void AP_ADSB_Sagetech::update()
// -----------------------------
uint32_t nbytes = MIN(_port->available(), 10 * PAYLOAD_XP_MAX_SIZE);
while (nbytes-- > 0) {
const int16_t data = (uint8_t)_port->read();
if (data < 0) {
uint8_t data;
if (!_port->read(data)) {
break;
}
if (parse_byte_XP((uint8_t)data)) {