From ebddaf8801f22db25825629f7f65760822d2f5d3 Mon Sep 17 00:00:00 2001 From: blckmn Date: Fri, 11 Nov 2016 09:05:27 +1100 Subject: [PATCH] Fix for esc4way and dshot May still require board reboot after flashing ESCs for dshot to re-enable correctly --- src/main/drivers/pwm_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/pwm_output.c b/src/main/drivers/pwm_output.c index 736b36d4cf..e57c27f2e4 100644 --- a/src/main/drivers/pwm_output.c +++ b/src/main/drivers/pwm_output.c @@ -120,6 +120,7 @@ void pwmShutdownPulsesForAllMotors(uint8_t motorCount) void pwmDisableMotors(void) { + pwmShutdownPulsesForAllMotors(MAX_SUPPORTED_MOTORS); pwmMotorsEnabled = false; } @@ -216,6 +217,8 @@ void motorInit(const motorConfig_t *motorConfig, uint16_t idlePulse, uint8_t mot break; } + motors[motorIndex].io = IOGetByTag(tag); + #ifdef USE_DSHOT if (isDigital) { pwmDigitalMotorHardwareConfig(timerHardware, motorIndex, motorConfig->motorPwmProtocol); @@ -224,7 +227,6 @@ void motorInit(const motorConfig_t *motorConfig, uint16_t idlePulse, uint8_t mot continue; } #endif - motors[motorIndex].io = IOGetByTag(tag); IOInit(motors[motorIndex].io, OWNER_MOTOR, RESOURCE_OUTPUT, RESOURCE_INDEX(motorIndex)); IOConfigGPIO(motors[motorIndex].io, IOCFG_AF_PP);