1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Fixed external barometer & magnetometer detection

This commit is contained in:
Konstantin Sharlaimov 2015-02-19 15:25:32 +10:00 committed by Dominic Clifton
parent e554f73f5c
commit 77e5be5002

View file

@ -381,12 +381,14 @@ static void detectBaro()
#ifdef USE_BARO_MS5611 #ifdef USE_BARO_MS5611
if (ms5611Detect(&baro)) { if (ms5611Detect(&baro)) {
sensorsSet(SENSOR_BARO);
return; return;
} }
#endif #endif
#ifdef USE_BARO_BMP085 #ifdef USE_BARO_BMP085
if (bmp085Detect(bmp085Config, &baro)) { if (bmp085Detect(bmp085Config, &baro)) {
sensorsSet(SENSOR_BARO);
return; return;
} }
#endif #endif
@ -440,6 +442,7 @@ retry:
#ifdef USE_MAG_HMC5883 #ifdef USE_MAG_HMC5883
case MAG_HMC5883: case MAG_HMC5883:
if (hmc5883lDetect(&mag, hmc5883Config)) { if (hmc5883lDetect(&mag, hmc5883Config)) {
sensorsSet(SENSOR_MAG);
#ifdef MAG_HMC5883_ALIGN #ifdef MAG_HMC5883_ALIGN
magAlign = MAG_HMC5883_ALIGN; magAlign = MAG_HMC5883_ALIGN;
#endif #endif
@ -455,6 +458,7 @@ retry:
case MAG_AK8975: case MAG_AK8975:
if (ak8975detect(&mag)) { if (ak8975detect(&mag)) {
sensorsSet(SENSOR_MAG);
#ifdef MAG_AK8975_ALIGN #ifdef MAG_AK8975_ALIGN
magAlign = MAG_AK8975_ALIGN; magAlign = MAG_AK8975_ALIGN;
#endif #endif