Skip to content

Commit

Permalink
FIX: Custom defaults - premature configuration (#12410)
Browse files Browse the repository at this point in the history
  • Loading branch information
blckmn committed Feb 23, 2023
1 parent 60369bc commit 7c6bf79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/sensors/gyro_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7c6bf79

Please sign in to comment.