1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/stm32: stm32f4 BRR from BSRR

This commit is contained in:
Karl Fessel 2023-05-25 23:04:38 +02:00 committed by Marian Buschsieweke
parent 84a3078a93
commit f8a64dfb1c
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -77,7 +77,9 @@ static inline void gpio_ll_clear(gpio_port_t port, uword_t mask)
#if defined(GPIO_BRR_BR0) && !defined(CPU_FAM_STM32F4)
p->BRR = mask;
#else
p->BSRR = mask << 16;
/* The first half-word sets GPIOs, the second half-world clears GPIOs */
volatile uint16_t *brr = (volatile uint16_t *)&(p->BSRR);
brr[1] = (uint16_t)mask;
#endif
}