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

stm32: fix compilation error when not using uart #2959

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ho-ho-ho
Copy link

@ho-ho-ho ho-ho-ho commented Jan 23, 2025

Describe the PR
When not using uart the macro UART_CLK_EN is most likely also not defined (as it is defined in the board.h alongside UART_DEV). On some stm32 families (i.e. l0 and f1) this is handled correctly and the UART_CLK_EN macro is called from the #ifdef UART_DEV section, but on some families the macro is always called, resulting in a undefined symbol compile error.

This pr moves the call to UART_CLK_EN into the conditional section for the families with the wrong behaviour. It also only creates the UartHandle variable when uart is actually in use (more in line with the behaviour of the stm32l0 family which I consider to be the best implementation of this conditional compilation part).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant