mirror of https://github.com/ArduPilot/ardupilot
GCS_MAVLink: send KDECAN ESC telemetry
This commit is contained in:
parent
f68f83505c
commit
ee13110ad0
|
@ -3949,6 +3949,28 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id)
|
|||
if (blheli) {
|
||||
blheli->send_esc_telemetry_mavlink(uint8_t(chan));
|
||||
}
|
||||
#endif
|
||||
#if HAL_WITH_UAVCAN
|
||||
uint8_t num_drivers = AP::can().get_num_drivers();
|
||||
|
||||
for (uint8_t i = 0; i < num_drivers; i++) {
|
||||
switch (AP::can().get_protocol_type(i)) {
|
||||
case AP_BoardConfig_CAN::Protocol_Type_KDECAN: {
|
||||
// To be replaced with macro saying if KDECAN library is included
|
||||
#if APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_ArduPlane) || APM_BUILD_TYPE(APM_BUILD_ArduSub)
|
||||
AP_KDECAN *ap_kdecan = AP_KDECAN::get_kdecan(i);
|
||||
if (ap_kdecan != nullptr) {
|
||||
ap_kdecan->send_mavlink(uint8_t(chan));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
case AP_BoardConfig_CAN::Protocol_Type_UAVCAN:
|
||||
case AP_BoardConfig_CAN::Protocol_Type_None:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue