mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Merge branch 'master' into development
This commit is contained in:
commit
05908aad4d
36 changed files with 957 additions and 183 deletions
|
@ -863,6 +863,19 @@ void mixTable(void *pidProfilePtr)
|
|||
}
|
||||
}
|
||||
|
||||
// Anti Desync feature for ESC's. Limit rapid throttle changes
|
||||
if (escAndServoConfig->maxEscThrottleJumpMs) {
|
||||
const int16_t maxThrottleStep = constrain(escAndServoConfig->maxEscThrottleJumpMs / (1000 / targetPidLooptime), 2, 10000);
|
||||
|
||||
// Only makes sense when it's within the range
|
||||
if (maxThrottleStep < throttleRange) {
|
||||
static int16_t motorPrevious[MAX_SUPPORTED_MOTORS];
|
||||
|
||||
motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, motorPrevious[i] + maxThrottleStep); // Only limit accelerating situation
|
||||
motorPrevious[i] = motor[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Disarmed mode
|
||||
if (!ARMING_FLAG(ARMED)) {
|
||||
for (i = 0; i < motorCount; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue