AP_Compass: probe for IST8308 on external buses

This commit is contained in:
Lucas De Marchi 2018-08-14 11:01:05 -07:00 committed by Lucas De Marchi
parent c3d87f91fc
commit 34fb98b1e0
2 changed files with 8 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include "AP_Compass_BMM150.h"
#include "AP_Compass_HIL.h"
#include "AP_Compass_HMC5843.h"
#include "AP_Compass_IST8308.h"
#include "AP_Compass_IST8310.h"
#include "AP_Compass_LSM303D.h"
#include "AP_Compass_LSM9DS1.h"
@ -681,6 +682,12 @@ void Compass::_probe_external_i2c_compasses(void)
all_external, default_rotation));
}
}
// external i2c bus
FOREACH_I2C_EXTERNAL(i) {
ADD_BACKEND(DRIVER_IST8308, AP_Compass_IST8308::probe(GET_I2C_DEVICE(i, HAL_COMPASS_IST8308_I2C_ADDR),
true, ROTATION_NONE));
}
#endif // HAL_MINIMIZE_FEATURES
}

View File

@ -378,6 +378,7 @@ private:
DRIVER_QMC5883 =12,
DRIVER_SITL =13,
DRIVER_MAG3110 =14,
DRIVER_IST8308 = 15,
};
bool _driver_enabled(enum DriverType driver_type);