diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index 017b3409b4..7d008f11c9 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -16,8 +16,8 @@ #include "AP_ESC_Telem.h" #include -#if HAL_WITH_UAVCAN - #include +#if HAL_MAX_CAN_PROTOCOL_DRIVERS + #include #include #include #include @@ -38,10 +38,10 @@ AP_ESC_Telem::AP_ESC_Telem() // get an individual ESC's usage time in seconds if available, returns true on success bool AP_ESC_Telem::get_usage_seconds(uint8_t esc_id, uint32_t& usage_sec) const { -#if HAL_WITH_UAVCAN +#if HAL_MAX_CAN_PROTOCOL_DRIVERS const uint8_t num_drivers = AP::can().get_num_drivers(); for (uint8_t i = 0; i < num_drivers; i++) { - if (AP::can().get_protocol_type(i) == AP_BoardConfig_CAN::Protocol_Type_ToshibaCAN) { + if (AP::can().get_driver_type(i) == AP_CANManager::Driver_Type_ToshibaCAN) { AP_ToshibaCAN *tcan = AP_ToshibaCAN::get_tcan(i); if (tcan != nullptr) { usage_sec = tcan->get_usage_seconds(esc_id);