AP_Baro: added all_healthy() method
This commit is contained in:
parent
8359c082ca
commit
1c2a6deaaf
@ -329,3 +329,16 @@ uint8_t AP_Baro::register_sensor(void)
|
||||
return _num_sensors++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
check if all barometers are healthy
|
||||
*/
|
||||
bool AP_Baro::all_healthy(void) const
|
||||
{
|
||||
for (uint8_t i=0; i<_num_sensors; i++) {
|
||||
if (!healthy(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return _num_sensors > 0;
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ public:
|
||||
bool healthy(void) const { return healthy(_primary); }
|
||||
bool healthy(uint8_t instance) const { return sensors[instance].healthy && sensors[instance].alt_ok; }
|
||||
|
||||
// check if all baros are healthy - used for SYS_STATUS report
|
||||
bool all_healthy(void) const;
|
||||
|
||||
// pressure in Pascal. Divide by 100 for millibars or hectopascals
|
||||
float get_pressure(void) const { return get_pressure(_primary); }
|
||||
float get_pressure(uint8_t instance) const { return sensors[instance].pressure; }
|
||||
|
Loading…
Reference in New Issue
Block a user