From 39dc553e157a71e337c643c14bdb0185822d20cf Mon Sep 17 00:00:00 2001 From: Bogdan Marinescu Date: Tue, 9 Aug 2016 13:59:22 +0300 Subject: [PATCH] Consistent default serial baud This commit changes the default baud of a new `Serial` or `SerialBase` instance to the one defined by the core configuration (`MBED_CONF_CORE_STDIO_BAUD_RATE`). This should ensure a consistent behaviour of newly created `Serial` objects across all platforms. Related to #2396. --- hal/common/SerialBase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hal/common/SerialBase.cpp b/hal/common/SerialBase.cpp index 891c4509751..2f20d8ed5c3 100644 --- a/hal/common/SerialBase.cpp +++ b/hal/common/SerialBase.cpp @@ -26,10 +26,11 @@ SerialBase::SerialBase(PinName tx, PinName rx) : _thunk_irq(this), _tx_usage(DMA_USAGE_NEVER), _rx_usage(DMA_USAGE_NEVER), #endif - _serial(), _baud(9600) { + _serial(), _baud(MBED_CONF_CORE_STDIO_BAUD_RATE) { // No lock needed in the constructor serial_init(&_serial, tx, rx); + serial_baud(&_serial, _baud); serial_irq_handler(&_serial, SerialBase::_irq_handler, (uint32_t)this); }