mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Merge pull request #7986 from ianrmurphy/add-rate-limits-to-msp
Added rate limit settings to MSP API 1.42 for configurator.
This commit is contained in:
commit
7d86cd6523
1 changed files with 13 additions and 1 deletions
|
@ -1007,7 +1007,12 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
|
||||||
// added in 1.41
|
// added in 1.41
|
||||||
sbufWriteU8(dst, currentControlRateProfile->throttle_limit_type);
|
sbufWriteU8(dst, currentControlRateProfile->throttle_limit_type);
|
||||||
sbufWriteU8(dst, currentControlRateProfile->throttle_limit_percent);
|
sbufWriteU8(dst, currentControlRateProfile->throttle_limit_percent);
|
||||||
|
|
||||||
|
// added in 1.42
|
||||||
|
sbufWriteU16(dst, currentControlRateProfile->rate_limit[FD_ROLL]);
|
||||||
|
sbufWriteU16(dst, currentControlRateProfile->rate_limit[FD_PITCH]);
|
||||||
|
sbufWriteU16(dst, currentControlRateProfile->rate_limit[FD_YAW]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_PID:
|
case MSP_PID:
|
||||||
|
@ -1854,6 +1859,13 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
|
||||||
currentControlRateProfile->throttle_limit_percent = sbufReadU8(src);
|
currentControlRateProfile->throttle_limit_percent = sbufReadU8(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// version 1.42
|
||||||
|
if (sbufBytesRemaining(src) >= 6) {
|
||||||
|
currentControlRateProfile->rate_limit[FD_ROLL] = sbufReadU16(src);
|
||||||
|
currentControlRateProfile->rate_limit[FD_PITCH] = sbufReadU16(src);
|
||||||
|
currentControlRateProfile->rate_limit[FD_YAW] = sbufReadU16(src);
|
||||||
|
}
|
||||||
|
|
||||||
initRcProcessing();
|
initRcProcessing();
|
||||||
} else {
|
} else {
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue