1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Moved further gyro parameters into gyroConfig_t

This commit is contained in:
Martin Budden 2016-11-24 07:24:17 +00:00
parent 0f082201f4
commit 78e6130aab
10 changed files with 41 additions and 50 deletions

View file

@ -564,15 +564,15 @@ void createDefaultConfig(master_t *config)
config->current_profile_index = 0; // default profile
config->dcm_kp = 2500; // 1.0 * 10000
config->dcm_ki = 0; // 0.003 * 10000
config->gyro_lpf = GYRO_LPF_256HZ; // 256HZ default
config->gyroConfig.gyro_lpf = GYRO_LPF_256HZ; // 256HZ default
#ifdef STM32F10X
config->gyro_sync_denom = 8;
config->gyroConfig.gyro_sync_denom = 8;
config->pid_process_denom = 1;
#elif defined(USE_GYRO_SPI_MPU6000) || defined(USE_GYRO_SPI_MPU6500) || defined(USE_GYRO_SPI_ICM20689)
config->gyro_sync_denom = 1;
config->gyroConfig.gyro_sync_denom = 1;
config->pid_process_denom = 4;
#else
config->gyro_sync_denom = 4;
config->gyroConfig.gyro_sync_denom = 4;
config->pid_process_denom = 2;
#endif
config->gyroConfig.gyro_soft_lpf_type = FILTER_PT1;
@ -830,8 +830,6 @@ void activateConfig(void)
&currentProfile->pidProfile
);
gyroUseConfig(&masterConfig.gyroConfig);
#ifdef TELEMETRY
telemetryUseConfig(&masterConfig.telemetryConfig);
#endif
@ -1003,9 +1001,9 @@ void validateAndFixGyroConfig(void)
masterConfig.gyroConfig.gyro_soft_notch_hz_2 = 0;
}
if (masterConfig.gyro_lpf != GYRO_LPF_256HZ && masterConfig.gyro_lpf != GYRO_LPF_NONE) {
if (masterConfig.gyroConfig.gyro_lpf != GYRO_LPF_256HZ && masterConfig.gyroConfig.gyro_lpf != GYRO_LPF_NONE) {
masterConfig.pid_process_denom = 1; // When gyro set to 1khz always set pid speed 1:1 to sampling speed
masterConfig.gyro_sync_denom = 1;
masterConfig.gyroConfig.gyro_sync_denom = 1;
}
}