1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Add throttle_limit settings to MSP

The feature has been in place and stable since 3.4 so it seems reasonable to add it to MSP so it can be added to the configurator.
This commit is contained in:
Bruce Luckcuck 2018-11-24 17:58:54 -05:00
parent e24a4fe4de
commit 78ecccd724

View file

@ -936,6 +936,11 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
sbufWriteU8(dst, currentControlRateProfile->rcRates[FD_YAW]);
sbufWriteU8(dst, currentControlRateProfile->rcRates[FD_PITCH]);
sbufWriteU8(dst, currentControlRateProfile->rcExpo[FD_PITCH]);
// added in 1.41
sbufWriteU8(dst, currentControlRateProfile->throttle_limit_type);
sbufWriteU8(dst, currentControlRateProfile->throttle_limit_percent);
break;
case MSP_PID:
@ -1672,6 +1677,12 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
if (sbufBytesRemaining(src) >= 1) {
currentControlRateProfile->rcExpo[FD_PITCH] = sbufReadU8(src);
}
// version 1.41
if (sbufBytesRemaining(src) >= 2) {
currentControlRateProfile->throttle_limit_type = sbufReadU8(src);
currentControlRateProfile->throttle_limit_percent = sbufReadU8(src);
}
initRcProcessing();
} else {