Compass_PX4: get_primary made public

This commit is contained in:
Randy Mackay 2014-07-22 21:57:22 +09:00
parent c16672a529
commit a6c29ba1c3
2 changed files with 6 additions and 4 deletions

View File

@ -135,9 +135,9 @@ bool AP_Compass_PX4::read(void)
_count[i] = 0; _count[i] = 0;
} }
last_update = _last_timestamp[_get_primary()]; last_update = _last_timestamp[get_primary()];
return _healthy[_get_primary()]; return _healthy[get_primary()];
} }
void AP_Compass_PX4::accumulate(void) void AP_Compass_PX4::accumulate(void)
@ -153,7 +153,7 @@ void AP_Compass_PX4::accumulate(void)
} }
} }
uint8_t AP_Compass_PX4::_get_primary(void) const uint8_t AP_Compass_PX4::get_primary(void) const
{ {
if (_primary < _num_instances && _healthy[_primary]) { if (_primary < _num_instances && _healthy[_primary]) {
return _primary; return _primary;

View File

@ -19,8 +19,10 @@ public:
// return the number of compass instances // return the number of compass instances
uint8_t get_count(void) const { return _num_instances; } uint8_t get_count(void) const { return _num_instances; }
// return the primary compass
uint8_t get_primary(void) const;
private: private:
uint8_t _get_primary(void) const;
uint8_t _num_instances; uint8_t _num_instances;
int _mag_fd[COMPASS_MAX_INSTANCES]; int _mag_fd[COMPASS_MAX_INSTANCES];
Vector3f _sum[COMPASS_MAX_INSTANCES]; Vector3f _sum[COMPASS_MAX_INSTANCES];