mirror of https://github.com/ArduPilot/ardupilot
AP_Compass: Add HMC5843 and second AK8963 autodetection to BBBmini
This commit is contained in:
parent
2aba5a4643
commit
3df5a02448
|
@ -453,6 +453,30 @@ void Compass::_detect_backends(void)
|
||||||
}
|
}
|
||||||
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_QFLIGHT
|
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_QFLIGHT
|
||||||
_add_backend(AP_Compass_QFLIGHT::detect(*this));
|
_add_backend(AP_Compass_QFLIGHT::detect(*this));
|
||||||
|
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_BBBMINI
|
||||||
|
AP_Compass_Backend *backend = AP_Compass_HMC5843::probe(*this, hal.i2c_mgr->get_device(HAL_COMPASS_HMC5843_I2C_BUS, HAL_COMPASS_HMC5843_I2C_ADDR));
|
||||||
|
if (backend) {
|
||||||
|
_add_backend(backend);
|
||||||
|
hal.console->printf("HMC5843: External compass detected\n");
|
||||||
|
} else {
|
||||||
|
hal.console->printf("HMC5843: External compass not detected\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
backend = AP_Compass_AK8963::probe_mpu9250(*this, 0);
|
||||||
|
if (backend) {
|
||||||
|
_add_backend(backend);
|
||||||
|
hal.console->printf("AK8953: Onboard compass detected\n");
|
||||||
|
} else {
|
||||||
|
hal.console->printf("AK8953: Onboard compass not detected\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
backend = AP_Compass_AK8963::probe_mpu9250(*this, 1);
|
||||||
|
if (backend) {
|
||||||
|
_add_backend(backend);
|
||||||
|
hal.console->printf("AK8953: External compass detected\n");
|
||||||
|
} else {
|
||||||
|
hal.console->printf("AK8953: External compass not detected\n");
|
||||||
|
}
|
||||||
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_AK8963_MPU9250
|
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_AK8963_MPU9250
|
||||||
_add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0));
|
_add_backend(AP_Compass_AK8963::probe_mpu9250(*this, 0));
|
||||||
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_HMC5843
|
#elif HAL_COMPASS_DEFAULT == HAL_COMPASS_HMC5843
|
||||||
|
|
Loading…
Reference in New Issue