AP_Compass: enabled AK8963 on PX4

This commit is contained in:
Andrew Tridgell 2016-11-04 11:07:21 +11:00
parent a06137bb68
commit 974827aa82
2 changed files with 4 additions and 3 deletions

View File

@ -503,6 +503,10 @@ void Compass::_detect_backends(void)
_add_backend(AP_Compass_LSM303D::probe(*this, hal.spi->get_device(HAL_INS_LSM9DS0_A_NAME)),
AP_Compass_LSM303D::name, false);
}
if (AP_BoardConfig::get_board_type() == AP_BoardConfig::PX4_BOARD_TEST_V4) {
_add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0),
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

View File

@ -18,8 +18,6 @@
#include <AP_Math/AP_Math.h>
#include <AP_HAL/AP_HAL.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
#include "AP_Compass_AK8963.h"
#include <AP_InertialSensor/AP_InertialSensor_MPU9250.h>
@ -426,4 +424,3 @@ bool AP_AK8963_BusDriver_Auxiliary::start_measurements()
return true;
}
#endif // CONFIG_HAL_BOARD