AP_UAVCAN: handle pop from rx_queue failing

This commit is contained in:
Peter Barker 2020-06-03 15:36:10 +10:00 committed by Randy Mackay
parent 4e3c23c969
commit 2ace0f0a1f

View File

@ -483,7 +483,9 @@ int16_t SLCAN::CAN::receive(uavcan::CanFrame& out_frame, uavcan::MonotonicTime&
out_ts_monotonic = uavcan::MonotonicTime::fromUSec(AP_HAL::micros64());; // High precision is not required for monotonic timestamps
uint64_t utc_usec;
CanRxItem frm;
rx_queue_.pop(frm);
if (!rx_queue_.pop(frm)) {
return 0;
}
out_frame = frm.frame;
utc_usec = frm.utc_usec;
out_flags = frm.flags;