diff --git a/libraries/AP_CANManager/AP_SLCANIface.cpp b/libraries/AP_CANManager/AP_SLCANIface.cpp index c19e3c56d6..c635494ac6 100644 --- a/libraries/AP_CANManager/AP_SLCANIface.cpp +++ b/libraries/AP_CANManager/AP_SLCANIface.cpp @@ -722,7 +722,7 @@ int16_t SLCAN::CANIface::receive(AP_HAL::CANFrame& out_frame, uint64_t& rx_time, // flush bytes from port while (num_bytes--) { uint8_t b; - if (!_port->read_locked(&b, 1, _serial_lock_key)) { + if (_port->read_locked(&b, 1, _serial_lock_key) != 1) { break; } addByte(b);