mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Add Thrust Linearization to MSP
Adds Thrust Linearization to MSP.
This commit is contained in:
parent
7503f06ce9
commit
a8cbd4d271
1 changed files with 11 additions and 1 deletions
|
@ -1861,6 +1861,11 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst)
|
|||
sbufWriteU8(dst, currentPidProfile->vbat_sag_compensation);
|
||||
#else
|
||||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
#if defined(USE_THRUST_LINEARIZATION)
|
||||
sbufWriteU8(dst, currentPidProfile->thrustLinearization);
|
||||
#else
|
||||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
break;
|
||||
case MSP_SENSOR_CONFIG:
|
||||
|
@ -2714,7 +2719,7 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
sbufReadU8(src);
|
||||
#endif
|
||||
}
|
||||
if (sbufBytesRemaining(src) >= 4) {
|
||||
if (sbufBytesRemaining(src) >= 5) {
|
||||
// Added in MSP API 1.44
|
||||
#if defined(USE_INTERPOLATED_SP)
|
||||
currentPidProfile->ff_interpolate_sp = sbufReadU8(src);
|
||||
|
@ -2728,6 +2733,11 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
currentPidProfile->vbat_sag_compensation = sbufReadU8(src);
|
||||
#else
|
||||
sbufReadU8(src);
|
||||
#endif
|
||||
#if defined(USE_THRUST_LINEARIZATION)
|
||||
currentPidProfile->thrustLinearization = sbufReadU8(src);
|
||||
#else
|
||||
sbufReadU8(src);
|
||||
#endif
|
||||
}
|
||||
pidInitConfig(currentPidProfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue