Skip to content

Commit

Permalink
Merge pull request #15457 from chrJost/Console_Pin_Checks
Browse files Browse the repository at this point in the history
STM32: disable CONSOLE_* checks in for serial if no console available
  • Loading branch information
0xc0170 authored Oct 18, 2023
2 parents b3a5d6a + 738419f commit 1a036c2
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 1a036c2

Please sign in to comment.