mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 15:14:00 -06:00
stm32: Make sure to enable the gpio clock prior to setting the first value
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
a67451fa36
commit
c930fc392b
4 changed files with 22 additions and 4 deletions
|
@ -52,6 +52,7 @@ gpio_out_setup(uint32_t pin, uint32_t val)
|
|||
if (GPIO2PORT(pin) >= ARRAY_SIZE(digital_regs))
|
||||
goto fail;
|
||||
GPIO_TypeDef *regs = digital_regs[GPIO2PORT(pin)];
|
||||
gpio_clock_enable(regs);
|
||||
struct gpio_out g = { .regs=regs, .bit=GPIO2BIT(pin) };
|
||||
gpio_out_reset(g, val);
|
||||
return g;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue