From 35451c7021b3454b7e987914c35726a989a8b3e0 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Sun, 24 Mar 2024 18:00:04 -0600 Subject: [PATCH] AP_ExternalAHRS: Check backend pre-arm before origin * This allows the backend to report more detailed errors * Before this, many pre-arm errors were hidden by origin failure * If pre-arm could report multiple errors, that would be ideal Signed-off-by: Ryan Friedman --- libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp index 0ad2a7233fca3..315cc17b22765 100644 --- a/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp +++ b/libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp @@ -235,11 +235,14 @@ bool AP_ExternalAHRS::pre_arm_check(char *failure_msg, uint8_t failure_msg_len) hal.util->snprintf(failure_msg, failure_msg_len, "ExternalAHRS: Invalid backend"); return false; } - + if (!backend->pre_arm_check(failure_msg, failure_msg_len)) { + return false; + } if (!state.have_origin) { hal.util->snprintf(failure_msg, failure_msg_len, "ExternalAHRS: No origin"); + return false; } - return backend->pre_arm_check(failure_msg, failure_msg_len); + return true; } /*