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: disable CONSOLE_* checks in for serial if no console available #15457

Merged
merged 1 commit into from
Oct 18, 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
2 changes: 2 additions & 0 deletions targets/TARGET_STM/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,15 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)

uint8_t stdio_config = false;

#if defined(MBED_CONF_TARGET_CONSOLE_UART)
if ((tx == CONSOLE_TX) || (rx == CONSOLE_RX)) {
stdio_config = true;
} else {
if (uart_tx == pinmap_peripheral(CONSOLE_TX, PinMap_UART_TX)) {
error("Error: new serial object is using same UART as STDIO");
}
}
#endif

const serial_pinmap_t explicit_uart_pinmap = {peripheral, tx, tx_function, rx, rx_function, stdio_config};

Expand Down
Loading