Browse Source

AP_UAVCAN: handle pop from rx_queue failing

c415-sdk
Peter Barker 5 years ago committed by Randy Mackay
parent
commit
2ace0f0a1f
  1. 4
      libraries/AP_UAVCAN/AP_UAVCAN_SLCAN.cpp

4
libraries/AP_UAVCAN/AP_UAVCAN_SLCAN.cpp

@ -483,7 +483,9 @@ int16_t SLCAN::CAN::receive(uavcan::CanFrame& out_frame, uavcan::MonotonicTime& @@ -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;

Loading…
Cancel
Save