HAL_ChibiOS: don't consider a MAVCAN send failure as a send failure

this prevents duplicate sends if MAVCAN buffer is full
This commit is contained in:
Andrew Tridgell 2023-06-07 14:51:12 +10:00
parent f0a0a4cfa9
commit 0cfd9c2ed5
2 changed files with 8 additions and 2 deletions

View File

@ -397,7 +397,10 @@ int16_t CANIface::send(const AP_HAL::CANFrame& frame, uint64_t tx_deadline,
pending_tx_[index].pushed = false;
}
return AP_HAL::CANIface::send(frame, tx_deadline, flags);
// also send on MAVCAN, but don't consider it an error if we can't get the MAVCAN out
AP_HAL::CANIface::send(frame, tx_deadline, flags);
return 1;
}
int16_t CANIface::receive(AP_HAL::CANFrame& out_frame, uint64_t& out_timestamp_us, CanIOFlags& out_flags)

View File

@ -360,7 +360,10 @@ int16_t CANIface::send(const AP_HAL::CANFrame& frame, uint64_t tx_deadline,
txi.pushed = false;
}
return AP_HAL::CANIface::send(frame, tx_deadline, flags);
// also send on MAVCAN, but don't consider it an error if we can't send
AP_HAL::CANIface::send(frame, tx_deadline, flags);
return 1;
}
int16_t CANIface::receive(AP_HAL::CANFrame& out_frame, uint64_t& out_timestamp_us, CanIOFlags& out_flags)