AP_Arming: allow precise wording of fence pre-arm messages

This commit is contained in:
Andy Piper 2024-06-22 16:52:43 +01:00 committed by Peter Barker
parent f0456f29dd
commit 37e0923ec2
1 changed files with 3 additions and 7 deletions

View File

@ -1280,16 +1280,12 @@ bool AP_Arming::fence_checks(bool display_failure)
}
// check fence is ready
const char *fail_msg = nullptr;
if (fence->pre_arm_check(fail_msg)) {
char fail_msg[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1];
if (fence->pre_arm_check(fail_msg, ARRAY_SIZE(fail_msg))) {
return true;
}
if (fail_msg == nullptr) {
check_failed(display_failure, "Check fence");
} else {
check_failed(display_failure, "%s", fail_msg);
}
check_failed(display_failure, "%s", fail_msg);
#if AP_SDCARD_STORAGE_ENABLED
if (fence->failed_sdcard_storage() || StorageManager::storage_failed()) {