Skip to content

Commit a74ffac

Browse files
committed
Remove usage of UARTSerial in Mbed OS Core diretories
Replace with BufferedSerial as UARTSerial has been deprecated.
1 parent 5fa7627 commit a74ffac

File tree

10 files changed

+18
-17
lines changed

10 files changed

+18
-17
lines changed

TEST_APPS/device/exampleapp/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int main()
5656

5757
FileHandle *mbed::mbed_override_console(int)
5858
{
59-
static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE);
59+
static BufferedSerial console(STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE);
6060
#if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
6161
console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
6262
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS

TEST_APPS/device/nfcapp/uart.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <stdio.h>
1717
#include <stdarg.h>
1818
#include "platform/FileHandle.h"
19-
#include "drivers/UARTSerial.h"
19+
#include "drivers/BufferedSerial.h"
2020

2121
/**
2222
* Macros for setting console flow control.
@@ -32,8 +32,9 @@
3232

3333
mbed::FileHandle *mbed::mbed_override_console(int)
3434
{
35-
static mbed::UARTSerial console(STDIO_UART_TX, STDIO_UART_RX,
36-
SERIAL_CONSOLE_BAUD_RATE);
35+
static mbed::BufferedSerial console(
36+
STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE
37+
);
3738
#if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
3839
mbed::console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
3940
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS

TEST_APPS/device/socket_app/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int main()
5757

5858
FileHandle *mbed::mbed_override_console(int)
5959
{
60-
static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE);
60+
static BufferedSerial console(STDIO_UART_TX, STDIO_UART_RX, SERIAL_CONSOLE_BAUD_RATE);
6161
#if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
6262
console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC);
6363
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS

drivers/SerialBase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace mbed {
3939
*/
4040

4141
/** A base class for serial port implementations
42-
* Can't be instantiated directly (use UnbufferedSerial or UARTSerial)
42+
* Can't be instantiated directly (use UnbufferedSerial or BufferedSerial)
4343
*
4444
* @note Synchronization level: Set by subclass
4545
*/

drivers/mbed_lib.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "drivers",
33
"config": {
44
"uart-serial-txbuf-size": {
5-
"help": "Default TX buffer size for a UARTSerial instance (unit Bytes))",
5+
"help": "Default TX buffer size for a BufferedSerial instance (unit Bytes))",
66
"value": 256
77
},
88
"uart-serial-rxbuf-size": {
9-
"help": "Default RX buffer size for a UARTSerial instance (unit Bytes))",
9+
"help": "Default RX buffer size for a BufferedSerial instance (unit Bytes))",
1010
"value": 256
1111
},
1212
"crc-table-size": {

platform/ATCmdParser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace mbed {
3939
*
4040
* Here are some examples:
4141
* @code
42-
* UARTSerial serial = UARTSerial(D1, D0);
42+
* BufferedSerial serial = BufferedSerial(D1, D0);
4343
* ATCmdParser at = ATCmdParser(&serial, "\r\n");
4444
* int value;
4545
* char buffer[100];

platform/mbed_lib.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313

1414
"stdio-buffered-serial": {
15-
"help": "(Applies if target.console-uart is true and stdio-minimal-console-only is false.) Use UARTSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.",
15+
"help": "(Applies if target.console-uart is true and stdio-minimal-console-only is false.) Use BufferedSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.",
1616
"value": false
1717
},
1818

platform/mbed_retarget.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class DirHandle;
100100
* to give the target a chance to specify a FileHandle for the console.
101101
*
102102
* If this is not provided or returns NULL, the console will be:
103-
* - UARTSerial if configuration option "platform.stdio-buffered-serial" is
103+
* - BufferedSerial if configuration option "platform.stdio-buffered-serial" is
104104
* true and the target has DEVICE_SERIAL;
105105
* - Raw HAL serial via serial_getc and serial_putc if
106106
* "platform.stdio-buffered-serial" is false and the target has DEVICE_SERIAL;
@@ -121,10 +121,10 @@ FileHandle *mbed_target_override_console(int fd);
121121
* by mbed_target_override_console, else will default to serial - see
122122
* mbed_target_override_console for more details.
123123
*
124-
* Example using UARTSerial:
124+
* Example using BufferedSerial:
125125
* @code
126126
* FileHandle *mbed::mbed_override_console(int) {
127-
* static UARTSerial my_serial(D0, D1);
127+
* static BufferedSerial my_serial(D0, D1);
128128
* return &my_serial;
129129
* }
130130
* @endcode

platform/source/mbed_board.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void mbed_error_vprintf(const char *format, va_list arg)
7575
void mbed_error_puts(const char *str)
7676
{
7777
// Writing the string to the console in a critical section is
78-
// potentially beneficial - for example in UARTSerial it
78+
// potentially beneficial - for example in BufferedSerial it
7979
// forces the "unbuffered" mode that makes sure all characters
8080
// go out now. If we made the call not in a critical section,
8181
// it would go to the software buffer and we would be reliant

platform/source/mbed_retarget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "platform/mbed_atomic.h"
3131
#include "platform/mbed_critical.h"
3232
#include "platform/mbed_poll.h"
33-
#include "drivers/UARTSerial.h"
33+
#include "drivers/BufferedSerial.h"
3434
#include "hal/us_ticker_api.h"
3535
#include "hal/lp_ticker_api.h"
3636
#include "hal/static_pinmap.h"
@@ -150,7 +150,7 @@ extern serial_t stdio_uart;
150150
/* Private FileHandle to implement backwards-compatible functionality of
151151
* direct HAL serial access for default stdin/stdout/stderr.
152152
* This is not a particularly well-behaved FileHandle for a stream, which
153-
* is why it's not public. People should be using UARTSerial.
153+
* is why it's not public. People should be using BufferedSerial.
154154
*/
155155
class DirectSerial : public FileHandle {
156156
public:
@@ -337,7 +337,7 @@ static FileHandle *default_console()
337337

338338
# if MBED_CONF_PLATFORM_STDIO_BUFFERED_SERIAL
339339
static const serial_pinmap_t console_pinmap = get_uart_pinmap(STDIO_UART_TX, STDIO_UART_RX);
340-
static UARTSerial console(console_pinmap, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
340+
static BufferedSerial console(console_pinmap, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
341341
# if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
342342
static const serial_fc_pinmap_t fc_pinmap = get_uart_fc_pinmap(STDIO_UART_RTS, NC);
343343
console.serial_set_flow_control(SerialBase::RTS, fc_pinmap);

0 commit comments

Comments
 (0)