AP_Baro: Move health to cpp and add range check

Moved the health checks to the cpp file and added range checking
This commit is contained in:
Hayden 2023-05-22 12:52:51 +10:00 committed by Peter Barker
parent 11dd9e8095
commit 30d575df12

View File

@ -58,9 +58,9 @@ public:
bool healthy(void) const { return healthy(_primary); } bool healthy(void) const { return healthy(_primary); }
#ifdef HAL_BUILD_AP_PERIPH #ifdef HAL_BUILD_AP_PERIPH
// calibration and alt check not valid for 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 #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 #endif
// check if all baros are healthy - used for SYS_STATUS report // check if all baros are healthy - used for SYS_STATUS report