Merge pull request #7227 from jflyper/bfdev-fix-gyro-detection-on-multi-gyro-boards-with-shared-SPI-bus

Do call gyroPreInitsensor for gyro 2 even if it is not activated
This commit is contained in:
Michael Keller 2018-12-18 02:12:01 +13:00 committed by GitHub
commit dd7a77e46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -495,13 +495,9 @@ static bool gyroInitSensor(gyroSensor_t *gyroSensor, const gyroDeviceConfig_t *c
void gyroPreInit(void)
{
if (gyroToUse == GYRO_CONFIG_USE_GYRO_1 || gyroToUse == GYRO_CONFIG_USE_GYRO_BOTH) {
gyroPreInitSensor(gyroDeviceConfig(0));
}
gyroPreInitSensor(gyroDeviceConfig(0));
#ifdef USE_MULTI_GYRO
if (gyroToUse == GYRO_CONFIG_USE_GYRO_2 || gyroToUse == GYRO_CONFIG_USE_GYRO_BOTH) {
gyroPreInitSensor(gyroDeviceConfig(1));
}
gyroPreInitSensor(gyroDeviceConfig(1));
#endif
}