diff options
Diffstat (limited to 'src/stm32f1/gpio.c')
-rw-r--r-- | src/stm32f1/gpio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stm32f1/gpio.c b/src/stm32f1/gpio.c index e6df3888..ed950461 100644 --- a/src/stm32f1/gpio.c +++ b/src/stm32f1/gpio.c @@ -114,7 +114,8 @@ gpio_in_reset(struct gpio_in g, int8_t pull_up) irqstatus_t flag = irq_save(); if (pull_up) { LL_GPIO_SetPinMode(g.regs, g.bit, LL_GPIO_MODE_INPUT); - LL_GPIO_SetPinPull(g.regs, g.bit, LL_GPIO_PULL_UP); + uint32_t p = pull_up > 0 ? LL_GPIO_PULL_UP : LL_GPIO_PULL_DOWN; + LL_GPIO_SetPinPull(g.regs, g.bit, p); } else { LL_GPIO_SetPinMode(g.regs, g.bit, LL_GPIO_MODE_FLOATING); } |