From bddd7e37f62081e839957181ffcad6cdd66b3ba9 Mon Sep 17 00:00:00 2001 From: Nicola De Pasquale Date: Wed, 5 Feb 2020 12:55:05 +0100 Subject: [PATCH] added dterm configurable expo curve to MSP --- src/main/msp/msp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/msp/msp.c b/src/main/msp/msp.c index 9720c9c067..c8df40efd2 100644 --- a/src/main/msp/msp.c +++ b/src/main/msp/msp.c @@ -1737,6 +1737,12 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst) #else sbufWriteU16(dst, 0); #endif +#if defined(USE_DYN_LPF) + // Added in MSP API 1.44 + sbufWriteU8(dst, currentPidProfile->dyn_lpf_curve_expo); +#else + sbufWriteU8(dst, 0); +#endif break; case MSP_PID_ADVANCED: @@ -2561,7 +2567,14 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP, sbufReadU16(src); #endif } - + if (sbufBytesRemaining(src) >= 1) { + // Added in MSP API 1.44 +#if defined(USE_DYN_LPF) + currentPidProfile->dyn_lpf_curve_expo = sbufReadU8(src); +#else + sbufReadU8(src); +#endif + } // reinitialize the gyro filters with the new values validateAndFixGyroConfig();