diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp index 33c2fe864b..8cd19ea4f3 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS_LORD.cpp @@ -111,9 +111,8 @@ void AP_ExternalAHRS_LORD::build_packet() WITH_SEMAPHORE(sem); uint32_t nbytes = MIN(uart->available(), 2048u); while (nbytes--> 0) { - const int16_t b = uart->read(); - - if (b < 0) { + uint8_t b; + if (!uart->read(b)) { break; }