mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Merge pull request #11779 from haslinghuis/update-pidprofile
Move TPA to PID profile
This commit is contained in:
commit
cbbc80ee90
11 changed files with 59 additions and 42 deletions
|
@ -1353,10 +1353,10 @@ static bool mspProcessOutCommand(mspDescriptor_t srcDesc, int16_t cmdMSP, sbuf_t
|
|||
for (int i = 0 ; i < 3; i++) {
|
||||
sbufWriteU8(dst, currentControlRateProfile->rates[i]); // R,P,Y see flight_dynamics_index_t
|
||||
}
|
||||
sbufWriteU8(dst, currentControlRateProfile->tpa_rate);
|
||||
sbufWriteU8(dst, 0); // was currentControlRateProfile->tpa_rate
|
||||
sbufWriteU8(dst, currentControlRateProfile->thrMid8);
|
||||
sbufWriteU8(dst, currentControlRateProfile->thrExpo8);
|
||||
sbufWriteU16(dst, currentControlRateProfile->tpa_breakpoint);
|
||||
sbufWriteU16(dst, 0); // was currentControlRateProfile->tpa_breakpoint
|
||||
sbufWriteU8(dst, currentControlRateProfile->rcExpo[FD_YAW]);
|
||||
sbufWriteU8(dst, currentControlRateProfile->rcRates[FD_YAW]);
|
||||
sbufWriteU8(dst, currentControlRateProfile->rcRates[FD_PITCH]);
|
||||
|
@ -2014,6 +2014,8 @@ static bool mspProcessOutCommand(mspDescriptor_t srcDesc, int16_t cmdMSP, sbuf_t
|
|||
#else
|
||||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
sbufWriteU8(dst, currentPidProfile->tpa_rate);
|
||||
sbufWriteU16(dst, currentPidProfile->tpa_breakpoint); // was currentControlRateProfile->tpa_breakpoint
|
||||
break;
|
||||
case MSP_SENSOR_CONFIG:
|
||||
#if defined(USE_ACC)
|
||||
|
@ -2666,11 +2668,10 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
currentControlRateProfile->rates[i] = sbufReadU8(src);
|
||||
}
|
||||
|
||||
value = sbufReadU8(src);
|
||||
currentControlRateProfile->tpa_rate = MIN(value, CONTROL_RATE_CONFIG_TPA_MAX);
|
||||
sbufReadU8(src); // tpa_rate is moved to PID profile
|
||||
currentControlRateProfile->thrMid8 = sbufReadU8(src);
|
||||
currentControlRateProfile->thrExpo8 = sbufReadU8(src);
|
||||
currentControlRateProfile->tpa_breakpoint = sbufReadU16(src);
|
||||
sbufReadU16(src); // tpa_breakpoint is moved to PID profile
|
||||
|
||||
if (sbufBytesRemaining(src) >= 1) {
|
||||
currentControlRateProfile->rcExpo[FD_YAW] = sbufReadU8(src);
|
||||
|
@ -3135,6 +3136,13 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
sbufReadU8(src);
|
||||
#endif
|
||||
}
|
||||
if (sbufBytesRemaining(src) >= 3) {
|
||||
// Added in API 1.45
|
||||
value = sbufReadU8(src);
|
||||
currentPidProfile->tpa_rate = MIN(value, TPA_MAX);
|
||||
currentPidProfile->tpa_breakpoint = sbufReadU16(src);
|
||||
}
|
||||
|
||||
pidInitConfig(currentPidProfile);
|
||||
initEscEndpoints();
|
||||
mixerInitProfile();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue