From 5becc24a1f97bbfebefa8c0ae48c9bea69e12c3c Mon Sep 17 00:00:00 2001 From: bresch Date: Wed, 27 Mar 2019 14:57:34 +0100 Subject: [PATCH] Failure detector - in failure detector preflight check, get vehicle_status as const type. Also use FAILURE_NONE enum to check for a failure --- src/modules/commander/PreflightCheck.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/PreflightCheck.cpp b/src/modules/commander/PreflightCheck.cpp index ebb2f7f405..14fad05310 100644 --- a/src/modules/commander/PreflightCheck.cpp +++ b/src/modules/commander/PreflightCheck.cpp @@ -674,7 +674,8 @@ out: return success; } -static bool failureDetectorCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, bool report_fail, bool prearm) +static bool failureDetectorCheck(orb_advert_t *mavlink_log_pub, const vehicle_status_s &status, bool report_fail, + bool prearm) { bool success = true; @@ -684,7 +685,7 @@ static bool failureDetectorCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s } - if (status.failure_detector_status != 0) { + if (status.failure_detector_status != vehicle_status_s::FAILURE_NONE) { success = false; if (report_fail) {