1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

FIX: Custom defaults - premature configuration (#12410)

This commit is contained in:
J Blackman 2023-02-24 10:37:33 +11:00 committed by GitHub
parent 60369bcf4f
commit 7c6bf79777
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -659,10 +659,13 @@ bool gyroInit(void)
gyro.gyroSensor2.gyroDev.dev.rxBuf = &gyroBuf2[GYRO_BUF_SIZE / 2];
gyroInitSensor(&gyro.gyroSensor2, gyroDeviceConfig(1));
gyro.gyroHasOverflowProtection = gyro.gyroHasOverflowProtection && gyro.gyroSensor2.gyroDev.gyroHasOverflowProtection;
gyro.gyroHasOverflowProtection = gyro.gyroHasOverflowProtection && gyro.gyroSensor2.gyroDev.gyroHasOverflowProtection;
detectedSensors[SENSOR_INDEX_GYRO] = gyro.gyroSensor2.gyroDev.gyroHardware;
}
#endif
#ifdef USE_CUSTOM_DEFAULTS
eepromWriteRequired = eepromWriteRequired && systemConfig()->configurationState != CONFIGURATION_STATE_DEFAULTS_BARE;
#endif
if (eepromWriteRequired) {
writeEEPROM();