Skip to content

Commit

Permalink
Add Thrust Linearization to MSP
Browse files Browse the repository at this point in the history
Adds Thrust Linearization to MSP.
  • Loading branch information
klutvott123 committed Oct 11, 2020
1 parent 7503f06 commit a8cbd4d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/msp/msp.c
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit a8cbd4d

Please sign in to comment.