Merge pull request #7736 from mikeller/add_dterm_filter2_type

Added MSP for dterm filter 2 type.
This commit is contained in:
Michael Keller 2019-03-08 13:18:17 +13:00 committed by GitHub
commit 362a8f4e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1407,6 +1407,8 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
sbufWriteU8(dst, gyroConfig()->gyro_lowpass_type);
sbufWriteU8(dst, gyroConfig()->gyro_lowpass2_type);
sbufWriteU16(dst, currentPidProfile->dterm_lowpass2_hz);
// Added in MSP API 1.41
sbufWriteU8(dst, currentPidProfile->dterm_filter2_type);
#if defined(USE_DYN_LPF)
sbufWriteU16(dst, gyroConfig()->dyn_lpf_gyro_min_hz);
sbufWriteU16(dst, gyroConfig()->dyn_lpf_gyro_max_hz);
@ -2062,7 +2064,9 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
gyroConfigMutable()->gyro_lowpass2_type = sbufReadU8(src);
currentPidProfile->dterm_lowpass2_hz = sbufReadU16(src);
}
if (sbufBytesRemaining(src) >= 8) {
if (sbufBytesRemaining(src) >= 9) {
// Added in MSP API 1.41
currentPidProfile->dterm_filter2_type = sbufReadU8(src);
#if defined(USE_DYN_LPF)
gyroConfigMutable()->dyn_lpf_gyro_min_hz = sbufReadU16(src);
gyroConfigMutable()->dyn_lpf_gyro_max_hz = sbufReadU16(src);