diff --git a/Tools/AP_Bootloader/can.cpp b/Tools/AP_Bootloader/can.cpp index e70173d9c5..ee41922143 100644 --- a/Tools/AP_Bootloader/can.cpp +++ b/Tools/AP_Bootloader/can.cpp @@ -54,7 +54,7 @@ static CANConfig cancfg = { 0 // filled in below }; #else -static ChibiOS::CANIface can_iface(0); +static ChibiOS::CANIface can_iface[HAL_NUM_CAN_IFACES]; #endif #ifndef CAN_APP_VERSION_MAJOR @@ -483,7 +483,11 @@ static void processTx(void) memcpy(txmsg.data, txf->data, 8); txmsg.id = (txf->id | AP_HAL::CANFrame::FlagEFF); // push message with 1s timeout - if (can_iface.send(txmsg, AP_HAL::micros64() + 1000000, 0) > 0) { + bool send_ok = false; + for (uint8_t i=0; i 0); + } + if (send_ok) { canardPopTxQueue(&canard); fail_count = 0; } else { @@ -503,25 +507,32 @@ static void processRx(void) { AP_HAL::CANFrame rxmsg; while (true) { - bool read_select = true; - bool write_select = false; - can_iface.select(read_select, write_select, nullptr, 0); - if (!read_select) { + bool got_pkt = false; + for (uint8_t i=0; i