Skip to content

Commit 1a036c2

Browse files
authored
Merge pull request #15457 from chrJost/Console_Pin_Checks
STM32: disable CONSOLE_* checks in for serial if no console available
2 parents b3a5d6a + 738419f commit 1a036c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

targets/TARGET_STM/serial_api.c

+2
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,15 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
205205

206206
uint8_t stdio_config = false;
207207

208+
#if defined(MBED_CONF_TARGET_CONSOLE_UART)
208209
if ((tx == CONSOLE_TX) || (rx == CONSOLE_RX)) {
209210
stdio_config = true;
210211
} else {
211212
if (uart_tx == pinmap_peripheral(CONSOLE_TX, PinMap_UART_TX)) {
212213
error("Error: new serial object is using same UART as STDIO");
213214
}
214215
}
216+
#endif
215217

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

0 commit comments

Comments
 (0)