Allow resorting to fake gyro if USE_FAKE_GYRO is defined

This commit is contained in:
jflyper 2019-07-16 13:49:58 +09:00
parent f4bb75180e
commit a78238e0f2
1 changed files with 5 additions and 1 deletions

View File

@ -416,9 +416,13 @@ static bool gyroDetectSensor(gyroSensor_t *gyroSensor, const gyroDeviceConfig_t
#if defined(USE_GYRO_MPU6050) || defined(USE_GYRO_MPU3050) || defined(USE_GYRO_MPU6500) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_MPU6000) \
|| defined(USE_ACC_MPU6050) || defined(USE_GYRO_SPI_MPU9250) || defined(USE_GYRO_SPI_ICM20601) || defined(USE_GYRO_SPI_ICM20649) || defined(USE_GYRO_SPI_ICM20689) || defined(USE_GYRO_L3GD20)
if (!mpuDetect(&gyroSensor->gyroDev, config)) {
bool gyroFound = mpuDetect(&gyroSensor->gyroDev, config);
#if !defined(USE_FAKE_GYRO) // Allow resorting to fake accgyro if defined
if (!gyroFound) {
return false;
}
#endif
#else
UNUSED(config);
#endif