Skip to content

Commit

Permalink
remove stdio checks in serial init if no console is available
Browse files Browse the repository at this point in the history
  • Loading branch information
chrJost committed Oct 10, 2023
1 parent b3a5d6a commit 738419f
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 738419f

Please sign in to comment.