Fallback to FakeGyro and FakeAcc (when enabled) after first searching

for other devices.

This helps when porting to new targets.
This commit is contained in:
Dominic Clifton 2014-09-05 20:51:39 +01:00
parent 2ae62d1977
commit 05be7c922c
1 changed files with 11 additions and 5 deletions

View File

@ -109,6 +109,11 @@
#undef USE_BARO_MS5611
#endif
#ifdef EUSTM32F103RC
#define USE_FAKE_GYRO
#define USE_FAKE_ACC
#endif
#ifdef STM32F3DISCOVERY
#undef USE_ACC_SPI_MPU6000
#undef USE_GYRO_SPI_MPU6000
@ -188,11 +193,6 @@ bool fakeAccDetect(acc_t *acc)
bool detectGyro(uint16_t gyroLpf)
{
gyroAlign = ALIGN_DEFAULT;
#ifdef USE_FAKE_GYRO
if (fakeGyroDetect(&gyro, gyroLpf)) {
return true;
}
#endif
#ifdef USE_GYRO_MPU6050
if (mpu6050GyroDetect(&gyro, gyroLpf)) {
@ -235,6 +235,12 @@ bool detectGyro(uint16_t gyroLpf)
return true;
}
#endif
#ifdef USE_FAKE_GYRO
if (fakeGyroDetect(&gyro, gyroLpf)) {
return true;
}
#endif
return false;
}