AP_Compass: updated backend detect method

Uses reimplemented AK8963 driver. There's also no need trying to detect this
compass twice. Actually, it might even be bad, because the current code can
allocate an AK8963 object twice.
This commit is contained in:
Staroselskii Georgii 2015-07-02 16:38:31 +03:00 committed by Andrew Tridgell
parent 7a417d1151
commit 26c8007c96

View File

@ -351,15 +351,13 @@ Compass::_detect_backends(void)
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX && CONFIG_HAL_BOARD_SUBTYPE != HAL_BOARD_SUBTYPE_LINUX_NONE
_add_backend(AP_Compass_HMC5843::detect);
_add_backend(AP_Compass_AK8963_MPU9250::detect);
_add_backend(AP_Compass_AK8963::detect);
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_HIL
_add_backend(AP_Compass_HIL::detect);
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_HMC5843
_add_backend(AP_Compass_HMC5843::detect);
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_PX4 || HAL_COMPASS_DEFAULT == HAL_COMPASS_VRBRAIN
_add_backend(AP_Compass_PX4::detect);
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_AK8963_MPU9250
_add_backend(AP_Compass_AK8963_MPU9250::detect);
#else
#error Unrecognised HAL_COMPASS_TYPE setting
#endif