From e6d4b2a087e08313d2f1902c115a977d57abadad Mon Sep 17 00:00:00 2001 From: Igor Anokhin Date: Thu, 26 Oct 2017 17:36:19 +0300 Subject: [PATCH] AP_InertialSensor: add LSM9DS1 entry Enable LSM9DS1 in case it is selected --- libraries/AP_InertialSensor/AP_InertialSensor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.cpp b/libraries/AP_InertialSensor/AP_InertialSensor.cpp index 14e82c5540..1626d1fcea 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor.cpp @@ -16,6 +16,7 @@ #include "AP_InertialSensor_HIL.h" #include "AP_InertialSensor_L3G4200D.h" #include "AP_InertialSensor_LSM9DS0.h" +#include "AP_InertialSensor_LSM9DS1.h" #include "AP_InertialSensor_Invensense.h" #include "AP_InertialSensor_PX4.h" #include "AP_InertialSensor_QURT.h" @@ -684,6 +685,7 @@ AP_InertialSensor::init(uint16_t sample_rate) bool AP_InertialSensor::_add_backend(AP_InertialSensor_Backend *backend) { + if (!backend) { return false; } @@ -849,6 +851,8 @@ AP_InertialSensor::detect_backends(void) #elif HAL_INS_DEFAULT == HAL_INS_EDGE ADD_BACKEND(AP_InertialSensor_Invensense::probe(*this, hal.spi->get_device(HAL_INS_MPU60x0_NAME), ROTATION_YAW_90)); ADD_BACKEND(AP_InertialSensor_Invensense::probe(*this, hal.spi->get_device(HAL_INS_MPU60x0_NAME_EXT), ROTATION_YAW_90)); +#elif HAL_INS_DEFAULT == HAL_INS_LSM9DS1 + ADD_BACKEND(AP_InertialSensor_LSM9DS1::probe(*this, hal.spi->get_device(HAL_INS_LSM9DS1_NAME))); #elif HAL_INS_DEFAULT == HAL_INS_LSM9DS0 ADD_BACKEND(AP_InertialSensor_LSM9DS0::probe(*this, hal.spi->get_device(HAL_INS_LSM9DS0_G_NAME),