AP_Compass: enable LSM9DS1 magnetometer for boards without default one

This commit is contained in:
Staroselskii Georgii 2016-04-22 18:12:23 +03:00 committed by Lucas De Marchi
parent f7846403e1
commit 71736a0ecc

View File

@ -10,6 +10,7 @@
#include "AP_Compass_HIL.h" #include "AP_Compass_HIL.h"
#include "AP_Compass_HMC5843.h" #include "AP_Compass_HMC5843.h"
#include "AP_Compass_LSM303D.h" #include "AP_Compass_LSM303D.h"
#include "AP_Compass_LSM9DS1.h"
#include "AP_Compass_PX4.h" #include "AP_Compass_PX4.h"
#include "AP_Compass_QURT.h" #include "AP_Compass_QURT.h"
#include "AP_Compass_qflight.h" #include "AP_Compass_qflight.h"
@ -503,6 +504,7 @@ void Compass::_detect_backends(void)
#elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX && CONFIG_HAL_BOARD_SUBTYPE != HAL_BOARD_SUBTYPE_LINUX_NONE #elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX && CONFIG_HAL_BOARD_SUBTYPE != HAL_BOARD_SUBTYPE_LINUX_NONE
_add_backend(AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(HAL_COMPASS_HMC5843_I2C_BUS, HAL_COMPASS_HMC5843_I2C_ADDR))); _add_backend(AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(HAL_COMPASS_HMC5843_I2C_BUS, HAL_COMPASS_HMC5843_I2C_ADDR)));
_add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0)); _add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0));
_add_backend(AP_Compass_LSM9DS1::probe(*this, hal.spi->get_device("lsm9ds1_m")));
#else #else
#error Unrecognised HAL_COMPASS_TYPE setting #error Unrecognised HAL_COMPASS_TYPE setting
#endif #endif