SRV_Channel: adapt to changes in AP_BoardConfig_CAN

This commit is contained in:
Francisco Ferreira 2018-07-18 07:27:38 +01:00
parent 3b61a31bb4
commit 861e1a0a54
No known key found for this signature in database
GPG Key ID: F63C20A6773E787E

View File

@ -238,8 +238,8 @@ void SRV_Channels::push()
#if HAL_WITH_UAVCAN #if HAL_WITH_UAVCAN
// push outputs to UAVCAN // push outputs to UAVCAN
uint8_t can_num_ifaces = AP_BoardConfig_CAN::get_can_num_ifaces(); uint8_t can_num_drivers = AP::can().get_num_drivers();
for (uint8_t i = 0; i < MAX_NUMBER_OF_CAN_DRIVERS && i < can_num_ifaces; i++) { for (uint8_t i = 0; i < can_num_drivers; i++) {
AP_UAVCAN *ap_uavcan = AP_UAVCAN::get_uavcan(i); AP_UAVCAN *ap_uavcan = AP_UAVCAN::get_uavcan(i);
if (ap_uavcan == nullptr) { if (ap_uavcan == nullptr) {
continue; continue;