1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

Run sensor detection to the end regardless of the gyro detection stataus

Is it harmful for drivers that handle mag inside the gyro chip?
This commit is contained in:
jflyper 2017-07-20 18:32:26 +09:00
parent 2c135547e5
commit 65d74fd6a7

View file

@ -56,12 +56,14 @@ static bool sonarDetect(void)
bool sensorsAutodetect(void) bool sensorsAutodetect(void)
{ {
// gyro must be initialised before accelerometer
if (!gyroInit()) {
return false;
}
accInit(gyro.targetLooptime); // gyro must be initialised before accelerometer
bool gyroDetected = gyroInit();
if (gyroDetected) {
accInit(gyro.targetLooptime);
}
#ifdef MAG #ifdef MAG
compassInit(); compassInit();
@ -77,5 +79,5 @@ bool sensorsAutodetect(void)
} }
#endif #endif
return true; return gyroDetected;
} }