AP_Arming: Don't allow same CAN rangefinder on different can bus

This commit is contained in:
rishabsingh3003 2023-07-18 15:26:48 +05:30 committed by Andrew Tridgell
parent 747c708dba
commit 3f65d713c8
1 changed files with 14 additions and 4 deletions

View File

@ -1220,15 +1220,25 @@ bool AP_Arming::can_checks(bool report)
#endif
break;
}
case AP_CAN::Protocol::EFI_NWPMU:
case AP_CAN::Protocol::USD1:
case AP_CAN::Protocol::TOFSenseP:
case AP_CAN::Protocol::NanoRadar_NRA24:
case AP_CAN::Protocol::Benewake:
{
for (uint8_t j = i; j; j--) {
if (AP::can().get_driver_type(i) == AP::can().get_driver_type(j-1)) {
check_failed(ARMING_CHECK_SYSTEM, report, "Same rfnd on different CAN ports");
return false;
}
}
break;
}
case AP_CAN::Protocol::EFI_NWPMU:
case AP_CAN::Protocol::None:
case AP_CAN::Protocol::Scripting:
case AP_CAN::Protocol::Scripting2:
case AP_CAN::Protocol::Benewake:
case AP_CAN::Protocol::KDECAN:
case AP_CAN::Protocol::TOFSenseP:
case AP_CAN::Protocol::NanoRadar_NRA24:
break;
}
}