From 126de5b07a02110bfd5dbfc890db84869769c935 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 22 Jun 2016 00:38:41 -0500 Subject: [PATCH] Added config option for stdio baud rate --- hal/common/retarget.cpp | 3 +++ mbed_lib.json | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/hal/common/retarget.cpp b/hal/common/retarget.cpp index 9fbc27b784..62c243af26 100644 --- a/hal/common/retarget.cpp +++ b/hal/common/retarget.cpp @@ -98,6 +98,9 @@ static void init_serial() { #if DEVICE_SERIAL if (stdio_uart_inited) return; serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX); +#if MBED_CONF_CORE_STDIO_BAUD_RATE + serial_baud(&stdio_uart, MBED_CONF_CORE_STDIO_BAUD_RATE); +#endif #endif } diff --git a/mbed_lib.json b/mbed_lib.json index 50cd29aa75..6300a4b0f2 100644 --- a/mbed_lib.json +++ b/mbed_lib.json @@ -4,6 +4,11 @@ "stdio-convert-newlines": { "help": "Enable conversion to standard newlines on stdin/stdout", "value": false + }, + + "stdio-baud-rate": { + "help": "Baud rate for stdio", + "value": 9600 } } }