Skip to content

Commit 089b67c

Browse files
authored
Merge pull request #2144 from geky/stdio-baud-config
Add config option for stdio baud rate
2 parents 4b441c9 + 126de5b commit 089b67c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

hal/common/retarget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ static void init_serial() {
9898
#if DEVICE_SERIAL
9999
if (stdio_uart_inited) return;
100100
serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX);
101+
#if MBED_CONF_CORE_STDIO_BAUD_RATE
102+
serial_baud(&stdio_uart, MBED_CONF_CORE_STDIO_BAUD_RATE);
103+
#endif
101104
#endif
102105
}
103106

mbed_lib.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"stdio-convert-newlines": {
55
"help": "Enable conversion to standard newlines on stdin/stdout",
66
"value": false
7+
},
8+
9+
"stdio-baud-rate": {
10+
"help": "Baud rate for stdio",
11+
"value": 9600
712
}
813
}
914
}

0 commit comments

Comments
 (0)