Merge pull request #1526 from blckmn/esc4way_dshot

Fix for esc4way and dshot
This commit is contained in:
J Blackman 2016-11-11 16:09:34 +11:00 committed by GitHub
commit 996b1a4aa9
1 changed files with 3 additions and 1 deletions

View File

@ -120,6 +120,7 @@ void pwmShutdownPulsesForAllMotors(uint8_t motorCount)
void pwmDisableMotors(void) void pwmDisableMotors(void)
{ {
pwmShutdownPulsesForAllMotors(MAX_SUPPORTED_MOTORS);
pwmMotorsEnabled = false; pwmMotorsEnabled = false;
} }
@ -216,6 +217,8 @@ void motorInit(const motorConfig_t *motorConfig, uint16_t idlePulse, uint8_t mot
break; break;
} }
motors[motorIndex].io = IOGetByTag(tag);
#ifdef USE_DSHOT #ifdef USE_DSHOT
if (isDigital) { if (isDigital) {
pwmDigitalMotorHardwareConfig(timerHardware, motorIndex, motorConfig->motorPwmProtocol); pwmDigitalMotorHardwareConfig(timerHardware, motorIndex, motorConfig->motorPwmProtocol);
@ -224,7 +227,6 @@ void motorInit(const motorConfig_t *motorConfig, uint16_t idlePulse, uint8_t mot
continue; continue;
} }
#endif #endif
motors[motorIndex].io = IOGetByTag(tag);
IOInit(motors[motorIndex].io, OWNER_MOTOR, RESOURCE_OUTPUT, RESOURCE_INDEX(motorIndex)); IOInit(motors[motorIndex].io, OWNER_MOTOR, RESOURCE_OUTPUT, RESOURCE_INDEX(motorIndex));
IOConfigGPIO(motors[motorIndex].io, IOCFG_AF_PP); IOConfigGPIO(motors[motorIndex].io, IOCFG_AF_PP);