HAL_SITL: support arrays of CAN interfaces

allows for multi-bus in AP_Periph
This commit is contained in:
Andrew Tridgell 2021-03-15 12:05:07 +11:00
parent 3590fe36e8
commit 4f1c43862e
2 changed files with 5 additions and 0 deletions

View File

@ -53,6 +53,8 @@ using namespace HALSITL;
CANIface::CANSocketEventSource CANIface::evt_can_socket[HAL_NUM_CAN_IFACES];
uint8_t CANIface::next_interface;
static can_frame makeSocketCanFrame(const AP_HAL::CANFrame& uavcan_frame)
{
can_frame sockcan_frame { uavcan_frame.id& AP_HAL::CANFrame::MaskExtID, uavcan_frame.dlc, { } };

View File

@ -62,6 +62,9 @@ public:
, _max_frames_in_socket_tx_queue(2)
{ }
static uint8_t next_interface;
CANIface() : CANIface(next_interface++) {}
~CANIface() { }
// Initialise CAN Peripheral