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

Tidied initialisation, especially PID filters

This commit is contained in:
Martin Budden 2016-11-23 14:09:08 +00:00
parent 81f6a1886a
commit e9407f3065
11 changed files with 82 additions and 44 deletions

View file

@ -1458,6 +1458,18 @@ static mspResult_e mspFcProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
masterConfig.gyro_soft_notch_hz_2 = sbufReadU16(src);
masterConfig.gyro_soft_notch_cutoff_2 = sbufReadU16(src);
}
// reinitialize the gyro filters with the new values
validateAndFixGyroConfig();
gyroUseConfig(&masterConfig.gyroConfig,
masterConfig.gyro_soft_lpf_hz,
masterConfig.gyro_soft_notch_hz_1,
masterConfig.gyro_soft_notch_cutoff_1,
masterConfig.gyro_soft_notch_hz_2,
masterConfig.gyro_soft_notch_cutoff_2,
masterConfig.gyro_soft_type);
gyroInit();
// reinitialize the PID filters with the new values
pidInitFilters(&currentProfile->pidProfile);
break;
case MSP_SET_PID_ADVANCED: