From 156efd6fece2fa3d9dcee9b2b6a89b7e093701b5 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Fri, 10 Feb 2017 15:33:23 -0800 Subject: [PATCH] AP_Compass: use IST8310 for aerofc --- libraries/AP_Compass/AP_Compass.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index c20a47362c..ca8f742b5e 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -10,6 +10,7 @@ #include "AP_Compass_BMM150.h" #include "AP_Compass_HIL.h" #include "AP_Compass_HMC5843.h" +#include "AP_Compass_IST8310.h" #include "AP_Compass_LSM303D.h" #include "AP_Compass_LSM9DS1.h" #include "AP_Compass_PX4.h" @@ -517,7 +518,6 @@ void Compass::_detect_backends(void) ADD_BACKEND(AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(0, HAL_COMPASS_HMC5843_I2C_ADDR), both_i2c_external, both_i2c_external?ROTATION_ROLL_180:ROTATION_YAW_270), AP_Compass_HMC5843::name, both_i2c_external); - #if !HAL_MINIMIZE_FEATURES #if 0 // lis3mdl - this is disabled for now due to an errata on pixhawk2 GPS unit, pending investigation @@ -540,6 +540,12 @@ void Compass::_detect_backends(void) } break; + case AP_BoardConfig::PX4_BOARD_AEROFC: +#ifdef HAL_COMPASS_IST8310_I2C_BUS + ADD_BACKEND(AP_Compass_IST8310::probe(*this, hal.i2c_mgr->get_device(HAL_COMPASS_IST8310_I2C_BUS, HAL_COMPASS_IST8310_I2C_ADDR), + ROTATION_PITCH_180_YAW_90), AP_Compass_IST8310::name, true); +#endif + break; default: break; }