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:
parent
2c135547e5
commit
65d74fd6a7
1 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue