mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Add vbat sag to msp 1.44, revise dyn_idle
This commit is contained in:
parent
7c50a3f364
commit
5e59c9e980
1 changed files with 20 additions and 3 deletions
|
@ -1821,7 +1821,11 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst)
|
|||
// Added in MSP API 1.43
|
||||
sbufWriteU8(dst, currentPidProfile->motor_output_limit);
|
||||
sbufWriteU8(dst, currentPidProfile->auto_profile_cell_count);
|
||||
#if defined(USE_DYN_IDLE)
|
||||
sbufWriteU8(dst, currentPidProfile->idle_min_rpm);
|
||||
#else
|
||||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
// Added in MSP API 1.44
|
||||
#if defined(USE_INTERPOLATED_SP)
|
||||
sbufWriteU8(dst, currentPidProfile->ff_interpolate_sp);
|
||||
|
@ -1831,7 +1835,11 @@ static bool mspProcessOutCommand(int16_t cmdMSP, sbuf_t *dst)
|
|||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
sbufWriteU8(dst, currentPidProfile->ff_boost);
|
||||
|
||||
#if defined(USE_BATTERY_VOLTAGE_SAG_COMPENSATION)
|
||||
sbufWriteU8(dst, currentPidProfile->vbat_sag_compensation);
|
||||
#else
|
||||
sbufWriteU8(dst, 0);
|
||||
#endif
|
||||
break;
|
||||
case MSP_SENSOR_CONFIG:
|
||||
#if defined(USE_ACC)
|
||||
|
@ -2684,9 +2692,13 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
// Added in MSP API 1.43
|
||||
currentPidProfile->motor_output_limit = sbufReadU8(src);
|
||||
currentPidProfile->auto_profile_cell_count = sbufReadU8(src);
|
||||
#if defined(USE_DYN_IDLE)
|
||||
currentPidProfile->idle_min_rpm = sbufReadU8(src);
|
||||
#else
|
||||
sbufReadU8(src);
|
||||
#endif
|
||||
}
|
||||
if (sbufBytesRemaining(src) >= 3) {
|
||||
if (sbufBytesRemaining(src) >= 4) {
|
||||
// Added in MSP API 1.44
|
||||
#if defined(USE_INTERPOLATED_SP)
|
||||
currentPidProfile->ff_interpolate_sp = sbufReadU8(src);
|
||||
|
@ -2696,6 +2708,11 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
sbufReadU8(src);
|
||||
#endif
|
||||
currentPidProfile->ff_boost = sbufReadU8(src);
|
||||
#if defined(USE_BATTERY_VOLTAGE_SAG_COMPENSATION)
|
||||
currentPidProfile->vbat_sag_compensation = sbufReadU8(src);
|
||||
#else
|
||||
sbufReadU8(src);
|
||||
#endif
|
||||
}
|
||||
pidInitConfig(currentPidProfile);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue