From 5d9fa7f85bd85ab90421279d3bc45c0234c2ed6b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Jan 2018 18:05:11 +1100 Subject: [PATCH] AP_Compass: support ChibiOS --- libraries/AP_Compass/AP_Compass.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index c437cb6e4b..4f5df8c3d4 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -560,7 +560,7 @@ void Compass::_detect_backends(void) #if HAL_COMPASS_DEFAULT == HAL_COMPASS_HIL ADD_BACKEND(DRIVER_SITL, AP_Compass_HIL::detect(*this), nullptr, false); -#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_PX4 || HAL_COMPASS_DEFAULT == HAL_COMPASS_VRBRAIN +#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_PX4 || HAL_COMPASS_DEFAULT == HAL_COMPASS_VRBRAIN || defined(HAL_CHIBIOS_ARCH_FMUV3) switch (AP_BoardConfig::get_board_type()) { case AP_BoardConfig::PX4_BOARD_PX4V1: case AP_BoardConfig::PX4_BOARD_PIXHAWK: @@ -802,6 +802,9 @@ void Compass::_detect_backends(void) AP_Compass_AK8963::name, false); ADD_BACKEND(DRIVER_LSM9DS1, AP_Compass_LSM9DS1::probe(*this, hal.spi->get_device("lsm9ds1_m")), AP_Compass_LSM9DS1::name, false); +#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412 + ADD_BACKEND(DRIVER_BMM150, AP_Compass_BMM150::probe(*this, hal.i2c_mgr->get_device(0, 0x10)), + AP_Compass_BMM150::name, true); #else #error Unrecognised HAL_COMPASS_TYPE setting #endif