diff --git a/lib/stm32/common/gpio_common_f24.c b/lib/stm32/common/gpio_common_f24.c index d464a506..b8802675 100644 --- a/lib/stm32/common/gpio_common_f24.c +++ b/lib/stm32/common/gpio_common_f24.c @@ -178,7 +178,7 @@ void gpio_set_af(u32 gpioport, u8 alt_func_num, u16 gpios) if (!((1 << i) & gpios)) continue; afrl &= ~GPIO_AFR_MASK(i); - afrl |= GPIO_AFR(i, alt_func_num); + afrh |= GPIO_AFR(i, alt_func_num); } for (i = 8; i < 16; i++) {