Merge pull request #3351 from mikeller/improve_dshot_reverse_condition
Refactored Dshot reverse condition block.
This commit is contained in:
commit
582af3d515
|
@ -206,21 +206,23 @@ void mwArm(void)
|
|||
return;
|
||||
}
|
||||
if (!ARMING_FLAG(PREVENT_ARMING)) {
|
||||
#ifdef USE_DSHOT
|
||||
#ifdef USE_DSHOT
|
||||
if (!feature(FEATURE_3D)) {
|
||||
//TODO: Use BOXDSHOTREVERSE here
|
||||
if (!feature(FEATURE_3D) && !IS_RC_MODE_ACTIVE(BOX3DDISABLESWITCH)) {
|
||||
if (!IS_RC_MODE_ACTIVE(BOX3DDISABLESWITCH)) {
|
||||
reverseMotors = false;
|
||||
for (unsigned index = 0; index < getMotorCount(); index++) {
|
||||
pwmWriteDshotCommand(index, DSHOT_CMD_SPIN_DIRECTION_NORMAL);
|
||||
}
|
||||
}
|
||||
if (!feature(FEATURE_3D) && IS_RC_MODE_ACTIVE(BOX3DDISABLESWITCH)) {
|
||||
} else {
|
||||
reverseMotors = true;
|
||||
for (unsigned index = 0; index < getMotorCount(); index++) {
|
||||
pwmWriteDshotCommand(index, DSHOT_CMD_SPIN_DIRECTION_REVERSED);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
ENABLE_ARMING_FLAG(ARMED);
|
||||
ENABLE_ARMING_FLAG(WAS_EVER_ARMED);
|
||||
headFreeModeHold = DECIDEGREES_TO_DEGREES(attitude.values.yaw);
|
||||
|
|
Loading…
Reference in New Issue