AP_Arming: add support for separate dna_server instances for AP_UAVCAN

This commit is contained in:
bugobliterator 2022-04-04 16:07:51 +05:30 committed by Andrew Tridgell
parent 7ff0af7a0d
commit 527f956786

View File

@ -1069,7 +1069,8 @@ bool AP_Arming::can_checks(bool report)
case AP_CANManager::Driver_Type_UAVCAN:
{
#if HAL_ENABLE_LIBUAVCAN_DRIVERS
if (!AP::uavcan_dna_server().prearm_check(fail_msg, ARRAY_SIZE(fail_msg))) {
AP_UAVCAN *ap_uavcan = AP_UAVCAN::get_uavcan(i);
if (ap_uavcan != nullptr && !ap_uavcan->prearm_check(fail_msg, ARRAY_SIZE(fail_msg))) {
check_failed(ARMING_CHECK_SYSTEM, report, "UAVCAN: %s", fail_msg);
return false;
}