mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-02-09 01:31:19 -07:00
stm32: Enable MOE bit in hard_pwm.c for all stm32 chips
Always enable the MOE bit. Reported by @tt33415366. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
dd625933f7
commit
ae3eb30f28
1 changed files with 6 additions and 3 deletions
|
|
@ -400,11 +400,14 @@ gpio_timer_setup(uint8_t pin, uint32_t cycle_time, uint32_t val,
|
|||
default:
|
||||
shutdown("Invalid PWM channel");
|
||||
}
|
||||
|
||||
// Enable PWM output
|
||||
p->timer->CR1 |= TIM_CR1_CEN;
|
||||
#if CONFIG_MACH_STM32H7 || CONFIG_MACH_STM32G0
|
||||
p->timer->BDTR |= TIM_BDTR_MOE;
|
||||
#endif
|
||||
|
||||
// Advanced timers need MOE enabled. On standard timers this is a
|
||||
// write to reserved memory, but that seems harmless in practice.
|
||||
p->timer->BDTR = TIM_BDTR_MOE;
|
||||
|
||||
return channel;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue