Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/stm32: stm32f4 BRR from BSRR #19670

Merged
merged 1 commit into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cpu/stm32/include/gpio_ll_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down