aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/gpio.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-08-20 01:04:20 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-08-20 01:10:14 -0400
commitc930fc392b6977b17d6f7953bd738583974208c2 (patch)
treee0198fd4ea70b358579673428da1cb91cc3ccfa9 /src/stm32/gpio.c
parenta67451fa3688c10faa4caf589235b07ef01c30f1 (diff)
downloadkutter-c930fc392b6977b17d6f7953bd738583974208c2.tar.gz
kutter-c930fc392b6977b17d6f7953bd738583974208c2.tar.xz
kutter-c930fc392b6977b17d6f7953bd738583974208c2.zip
stm32: Make sure to enable the gpio clock prior to setting the first value
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/gpio.c')
-rw-r--r--src/stm32/gpio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stm32/gpio.c b/src/stm32/gpio.c
index 9fbbdaec..8db0b7c4 100644
--- a/src/stm32/gpio.c
+++ b/src/stm32/gpio.c
@@ -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;