mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Compass: Move health to cpp and add range check
Moved the health check to the cpp file and added checking of max instances
This commit is contained in:
parent
30d575df12
commit
fa800e23e2
@ -2066,6 +2066,11 @@ bool Compass::consistent() const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Compass::healthy(uint8_t i) const
|
||||
{
|
||||
return (i < COMPASS_MAX_INSTANCES) ? _get_state(Priority(i)).healthy : false;
|
||||
}
|
||||
|
||||
/*
|
||||
return true if we have a valid scale factor
|
||||
*/
|
||||
|
@ -205,7 +205,7 @@ public:
|
||||
bool consistent() const;
|
||||
|
||||
/// Return the health of a compass
|
||||
bool healthy(uint8_t i) const { return _get_state(Priority(i)).healthy; }
|
||||
bool healthy(uint8_t i) const;
|
||||
bool healthy(void) const { return healthy(_first_usable); }
|
||||
uint8_t get_healthy_mask() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user