1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Fixed Dshot command issues with BLHeli_S ESCs.

This commit is contained in:
Michael Keller 2017-09-05 08:30:03 +12:00
parent 76207372a4
commit 4b2e3c6dda
3 changed files with 9 additions and 1 deletions

View file

@ -384,7 +384,7 @@ void pwmWriteDshotCommand(uint8_t index, uint8_t motorCount, uint8_t command)
case DSHOT_CMD_SAVE_SETTINGS:
case DSHOT_CMD_SPIN_DIRECTION_NORMAL:
case DSHOT_CMD_SPIN_DIRECTION_REVERSED:
repeats = 20;
repeats = 10;
break;
default:
repeats = 1;

View file

@ -262,6 +262,8 @@ void tryArm(void)
}
#ifdef USE_DSHOT
if (isMotorProtocolDshot() && isModeActivationConditionPresent(BOXDSHOTREVERSE)) {
pwmDisableMotors();
if (!IS_RC_MODE_ACTIVE(BOXDSHOTREVERSE)) {
reverseMotors = false;
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_NORMAL);
@ -269,6 +271,8 @@ void tryArm(void)
reverseMotors = true;
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_SPIN_DIRECTION_REVERSED);
}
pwmEnableMotors();
}
#endif

View file

@ -364,7 +364,11 @@ void beeperUpdate(timeUs_t currentTimeUs)
#ifdef USE_DSHOT
if (!areMotorsRunning() && beeperConfig()->dshotForward && currentBeeperEntry->mode == BEEPER_RX_SET) {
pwmDisableMotors();
pwmWriteDshotCommand(ALL_MOTORS, getMotorCount(), DSHOT_CMD_BEEP3);
pwmEnableMotors();
}
#endif