Added MSP for dterm filter 2 type.

This commit is contained in:
mikeller 2019-03-08 08:29:26 +13:00
parent 80b3a116d3
commit c4cb671b70
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);
@ -2054,7 +2056,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);