mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Added blocked dshot commands, Added post command delay
Moved the dshotcommand to happen in pwm_output_dshot. Simplified the timing and repeats to happen on a group basis instead works better for dshotburst
This commit is contained in:
parent
f37a8184d5
commit
0045b36320
8 changed files with 131 additions and 42 deletions
|
@ -329,10 +329,7 @@ void disarm(void)
|
|||
if (isMotorProtocolDshot() && isModeActivationConditionPresent(BOXFLIPOVERAFTERCRASH) && !feature(FEATURE_3D)) {
|
||||
flipOverAfterCrashMode = false;
|
||||
if (!feature(FEATURE_3D)) {
|
||||
pwmDisableMotors();
|
||||
delay(1);
|
||||
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_NORMAL);
|
||||
pwmEnableMotors();
|
||||
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_NORMAL, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -357,13 +354,10 @@ void tryArm(void)
|
|||
}
|
||||
#ifdef USE_DSHOT
|
||||
if (isMotorProtocolDshot() && isModeActivationConditionPresent(BOXFLIPOVERAFTERCRASH)) {
|
||||
pwmDisableMotors();
|
||||
delay(1);
|
||||
|
||||
if (!IS_RC_MODE_ACTIVE(BOXFLIPOVERAFTERCRASH)) {
|
||||
flipOverAfterCrashMode = false;
|
||||
if (!feature(FEATURE_3D)) {
|
||||
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_NORMAL);
|
||||
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_NORMAL, false);
|
||||
}
|
||||
} else {
|
||||
flipOverAfterCrashMode = true;
|
||||
|
@ -371,11 +365,9 @@ void tryArm(void)
|
|||
runawayTakeoffCheckDisabled = false;
|
||||
#endif
|
||||
if (!feature(FEATURE_3D)) {
|
||||
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_REVERSED);
|
||||
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_REVERSED, false);
|
||||
}
|
||||
}
|
||||
|
||||
pwmEnableMotors();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue