diff --git a/src/main/drivers/pwm_output_dshot.c b/src/main/drivers/pwm_output_dshot.c index 12f3928536..3891fb98b5 100644 --- a/src/main/drivers/pwm_output_dshot.c +++ b/src/main/drivers/pwm_output_dshot.c @@ -393,10 +393,6 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m ( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH)) / getDshotHz(pwmProtocolType); pwmDshotSetDirectionOutput(motor, true); - if (useDshotTelemetry) { - // avoid high line during startup to prevent bootloader activation - *timerChCCR(timerHardware) = 0xffff; - } #else pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT); #endif @@ -420,6 +416,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m TIM_CtrlPWMOutputs(timer, ENABLE); TIM_Cmd(timer, ENABLE); } +#ifdef USE_DSHOT_TELEMETRY + if (useDshotTelemetry) { + // avoid high line during startup to prevent bootloader activation + *timerChCCR(timerHardware) = 0xffff; + } +#endif motor->configured = true; } diff --git a/src/main/drivers/pwm_output_dshot_hal.c b/src/main/drivers/pwm_output_dshot_hal.c index d56ee9810b..e714cc05ad 100644 --- a/src/main/drivers/pwm_output_dshot_hal.c +++ b/src/main/drivers/pwm_output_dshot_hal.c @@ -354,10 +354,6 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m ( 2 + (motor->useProshot ? 4 * MOTOR_NIBBLE_LENGTH_PROSHOT : 16 * MOTOR_BITLENGTH)) / getDshotHz(pwmProtocolType); pwmDshotSetDirectionOutput(motor, true); - if (useDshotTelemetry) { - // avoid high line during startup to prevent bootloader activation - *timerChCCR(timerHardware) = 0xffff; - } #else pwmDshotSetDirectionOutput(motor, true, &OCINIT, &DMAINIT); #endif @@ -386,6 +382,12 @@ void pwmDshotMotorHardwareConfig(const timerHardware_t *timerHardware, uint8_t m LL_TIM_EnableARRPreload(timer); LL_TIM_EnableCounter(timer); } +#ifdef USE_DSHOT_TELEMETRY + if (useDshotTelemetry) { + // avoid high line during startup to prevent bootloader activation + *timerChCCR(timerHardware) = 0xffff; + } +#endif motor->configured = true; } #endif