AP_Compass: enable in-tree drivers for PHMINI

This commit is contained in:
Andrew Tridgell 2016-11-09 11:33:37 +11:00
parent 03b7bc9e65
commit b363a65c2e
1 changed files with 6 additions and 1 deletions

View File

@ -495,7 +495,8 @@ void Compass::_detect_backends(void)
if (AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_TEST_V1 ||
AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_TEST_V2 ||
AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_TEST_V3 ||
AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_TEST_V4) {
AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_TEST_V4 ||
AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_PHMINI) {
// external i2c bus
_add_backend(AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(1, HAL_COMPASS_HMC5843_I2C_ADDR),
true, ROTATION_ROLL_180),
@ -524,6 +525,10 @@ void Compass::_detect_backends(void)
_add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0, ROTATION_ROLL_180_YAW_90),
AP_Compass_AK8963::name, false);
}
if (AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_PHMINI) {
_add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0, ROTATION_ROLL_180),
AP_Compass_AK8963::name, false);
}
// also add any px4 level drivers (for canbus magnetometers)
_add_backend(AP_Compass_PX4::detect(*this), nullptr, false);
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_QURT