Skip to content

Commit

Permalink
Change baro detect order to prevent MS5611 misdetection (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalentity authored Sep 6, 2016
1 parent 3519cda commit 6cc415a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/sensors/initialisation.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,6 @@ static bool detectBaro(baroSensor_e baroHardwareToUse)
case BARO_DEFAULT:
; // fallthough

case BARO_MS5611:
#ifdef USE_BARO_MS5611
if (ms5611Detect(&baro)) {
baroHardware = BARO_MS5611;
break;
}
#endif
; // fallthough
case BARO_BMP085:
#ifdef USE_BARO_BMP085
if (bmp085Detect(bmp085Config, &baro)) {
Expand All @@ -522,6 +514,14 @@ static bool detectBaro(baroSensor_e baroHardwareToUse)
}
#endif
; // fallthough
case BARO_MS5611:
#ifdef USE_BARO_MS5611
if (ms5611Detect(&baro)) {
baroHardware = BARO_MS5611;
break;
}
#endif
; // fallthough
case BARO_BMP280:
#ifdef USE_BARO_BMP280
if (bmp280Detect(&baro)) {
Expand Down

0 comments on commit 6cc415a

Please sign in to comment.