summaryrefslogtreecommitdiff
path: root/chip/stm32/gpio-stm32l15x.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/gpio-stm32l15x.c')
-rw-r--r--chip/stm32/gpio-stm32l15x.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/chip/stm32/gpio-stm32l15x.c b/chip/stm32/gpio-stm32l15x.c
index c80e57604b..f5513dafb8 100644
--- a/chip/stm32/gpio-stm32l15x.c
+++ b/chip/stm32/gpio-stm32l15x.c
@@ -42,9 +42,11 @@ int gpio_pre_init(void)
uint32_t val;
val = STM32_GPIO_PUPDR_OFF(g->port) & ~mask2;
- if (g->flags & GPIO_PULL_UP) /* Pull Up = 01 */
+ if ((g->flags & GPIO_PULL_UP) == GPIO_PULL_UP)
+ /* Pull Up = 01 */
val |= 0x55555555 & mask2;
- else if (g->flags & GPIO_PULL_DOWN) /* Pull Down = 10 */
+ else if ((g->flags & GPIO_PULL_DOWN) == GPIO_PULL_DOWN)
+ /* Pull Down = 10 */
val |= 0xaaaaaaaa & mask2;
STM32_GPIO_PUPDR_OFF(g->port) = val;