1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Change baro detect order

Probe BMP085/BMP180 before MS5611, because BMP085 can be misdetected as a MS5611.
This commit is contained in:
André 2016-08-29 16:48:33 +02:00 committed by GitHub
parent d81c45f3a7
commit 7f325373d1

View file

@ -460,7 +460,14 @@ static void detectBaro(baroSensor_e baroHardwareToUse)
switch (baroHardware) {
case BARO_DEFAULT:
; // fallthough
case BARO_BMP085:
#ifdef USE_BARO_BMP085
if (bmp085Detect(bmp085Config, &baro)) {
baroHardware = BARO_BMP085;
break;
}
#endif
; // fallthough
case BARO_MS5611:
#ifdef USE_BARO_MS5611
if (ms5611Detect(&baro)) {
@ -469,14 +476,6 @@ static void detectBaro(baroSensor_e baroHardwareToUse)
}
#endif
; // fallthough
case BARO_BMP085:
#ifdef USE_BARO_BMP085
if (bmp085Detect(bmp085Config, &baro)) {
baroHardware = BARO_BMP085;
break;
}
#endif
; // fallthough
case BARO_BMP280:
#ifdef USE_BARO_BMP280
if (bmp280Detect(&baro)) {
@ -484,6 +483,7 @@ static void detectBaro(baroSensor_e baroHardwareToUse)
break;
}
#endif
; // fallthough
case BARO_NONE:
baroHardware = BARO_NONE;
break;