AP_InertialSensor: Make detect_backends() public

This method will be used to initialize and configure I2C backends that
have an auxiliary I2C bus that can be connected to the main I2C bus,
like MPU6000 and MPU9250.
This commit is contained in:
José Roberto de Souza 2015-10-13 15:33:20 -03:00 committed by Andrew Tridgell
parent 0cbe99a862
commit d1ff4286c2
2 changed files with 7 additions and 6 deletions

View File

@ -389,12 +389,12 @@ uint8_t AP_InertialSensor::register_accel(void)
/*
* Start all backends for gyro and accel measurements. It automatically calls
* _detect_backends() if it has not been called already.
* detect_backends() if it has not been called already.
*/
void AP_InertialSensor::_start_backends()
{
_detect_backends();
detect_backends();
for (uint8_t i = 0; i < _backend_count; i++) {
_backends[i]->start();
@ -485,8 +485,8 @@ void AP_InertialSensor::_add_backend(AP_InertialSensor_Backend *backend)
/*
detect available backends for this board
*/
void
AP_InertialSensor::_detect_backends(void)
void
AP_InertialSensor::detect_backends(void)
{
if (_backends_detected)
return;
@ -1552,7 +1552,7 @@ void AP_InertialSensor::set_delta_angle(uint8_t instance, const Vector3f &deltaa
*/
AuxiliaryBus *AP_InertialSensor::get_auxiliary_bus(int16_t backend_id, uint8_t instance)
{
_detect_backends();
detect_backends();
AP_InertialSensor_Backend *backend = _find_backend(backend_id, instance);
if (backend == NULL)

View File

@ -228,11 +228,12 @@ public:
AuxiliaryBus *get_auxiliary_bus(int16_t backend_id) { return get_auxiliary_bus(backend_id, 0); }
AuxiliaryBus *get_auxiliary_bus(int16_t backend_id, uint8_t instance);
void detect_backends(void);
private:
// load backend drivers
void _add_backend(AP_InertialSensor_Backend *backend);
void _detect_backends(void);
void _start_backends();
AP_InertialSensor_Backend *_find_backend(int16_t backend_id, uint8_t instance);