From 738419f6b73507d6251b0febd87d4489fcc2ce45 Mon Sep 17 00:00:00 2001 From: "Jost, Chris" <79271064+chrJost@users.noreply.github.com> Date: Tue, 10 Oct 2023 10:52:09 +0200 Subject: [PATCH] remove stdio checks in serial init if no console is available --- targets/TARGET_STM/serial_api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/targets/TARGET_STM/serial_api.c b/targets/TARGET_STM/serial_api.c index b7ce63f546e..9875c6ed5e0 100644 --- a/targets/TARGET_STM/serial_api.c +++ b/targets/TARGET_STM/serial_api.c @@ -205,6 +205,7 @@ 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 { @@ -212,6 +213,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) 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};