Skip to content

Commit 6cc415a

Browse files
Change baro detect order to prevent MS5611 misdetection (#566)
1 parent 3519cda commit 6cc415a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/sensors/initialisation.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,6 @@ static bool detectBaro(baroSensor_e baroHardwareToUse)
506506
case BARO_DEFAULT:
507507
; // fallthough
508508

509-
case BARO_MS5611:
510-
#ifdef USE_BARO_MS5611
511-
if (ms5611Detect(&baro)) {
512-
baroHardware = BARO_MS5611;
513-
break;
514-
}
515-
#endif
516-
; // fallthough
517509
case BARO_BMP085:
518510
#ifdef USE_BARO_BMP085
519511
if (bmp085Detect(bmp085Config, &baro)) {
@@ -522,6 +514,14 @@ static bool detectBaro(baroSensor_e baroHardwareToUse)
522514
}
523515
#endif
524516
; // fallthough
517+
case BARO_MS5611:
518+
#ifdef USE_BARO_MS5611
519+
if (ms5611Detect(&baro)) {
520+
baroHardware = BARO_MS5611;
521+
break;
522+
}
523+
#endif
524+
; // fallthough
525525
case BARO_BMP280:
526526
#ifdef USE_BARO_BMP280
527527
if (bmp280Detect(&baro)) {

0 commit comments

Comments
 (0)