1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Merge pull request #9465 from Asizon/ffOptionsToMsp

This commit is contained in:
Michael Keller 2020-06-21 15:32:38 +12:00 committed by GitHub
commit 4b60b3ee4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1822,6 +1822,15 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst)
sbufWriteU8(dst, currentPidProfile->motor_output_limit);
sbufWriteU8(dst, currentPidProfile->auto_profile_cell_count);
sbufWriteU8(dst, currentPidProfile->idle_min_rpm);
// Added in MSP API 1.44
#if defined(USE_INTERPOLATED_SP)
sbufWriteU8(dst, currentPidProfile->ff_interpolate_sp);
sbufWriteU8(dst, currentPidProfile->ff_smooth_factor);
#else
sbufWriteU8(dst, 0);
sbufWriteU8(dst, 0);
#endif
sbufWriteU8(dst, currentPidProfile->ff_boost);
break;
case MSP_SENSOR_CONFIG:
@ -2677,6 +2686,17 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
currentPidProfile->auto_profile_cell_count = sbufReadU8(src);
currentPidProfile->idle_min_rpm = sbufReadU8(src);
}
if (sbufBytesRemaining(src) >= 3) {
// Added in MSP API 1.44
#if defined(USE_INTERPOLATED_SP)
currentPidProfile->ff_interpolate_sp = sbufReadU8(src);
currentPidProfile->ff_smooth_factor = sbufReadU8(src);
#else
sbufReadU8(src);
sbufReadU8(src);
#endif
currentPidProfile->ff_boost = sbufReadU8(src);
}
pidInitConfig(currentPidProfile);
break;