From 30d575df122308066a26d71aeba98b42b6ad7d1c Mon Sep 17 00:00:00 2001 From: Hayden Date: Mon, 22 May 2023 12:52:51 +1000 Subject: [PATCH] AP_Baro: Move health to cpp and add range check Moved the health checks to the cpp file and added range checking --- libraries/AP_Baro/AP_Baro.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Baro/AP_Baro.h b/libraries/AP_Baro/AP_Baro.h index ba76b23419..a1b4b63242 100644 --- a/libraries/AP_Baro/AP_Baro.h +++ b/libraries/AP_Baro/AP_Baro.h @@ -58,9 +58,9 @@ public: bool healthy(void) const { return healthy(_primary); } #ifdef HAL_BUILD_AP_PERIPH // calibration and alt check not valid for AP_Periph - bool healthy(uint8_t instance) const { return sensors[instance].healthy; } + bool healthy(uint8_t instance) const; #else - bool healthy(uint8_t instance) const { return sensors[instance].healthy && sensors[instance].alt_ok && sensors[instance].calibrated; } + bool healthy(uint8_t instance) const; #endif // check if all baros are healthy - used for SYS_STATUS report