mirror of https://github.com/ARMmbed/mbed-os.git
Fix a bug that Serial driver would read 1Byte garbage data(0xFE).
Serial driver would read 1Byte garbage data(0xFE) at first after reset and start.pull/933/head
parent
0365977217
commit
2047acae11
|
@ -235,8 +235,6 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
|
|||
b0 SPB2DT - Serial port break data : High-level */
|
||||
obj->uart->SCSPTR = 0x0003u; // SPB2IO = 1, SPB2DT = 1
|
||||
|
||||
obj->uart->SCSCR = 0x00F0;
|
||||
|
||||
/* ---- Line status register (SCLSR) setting ----
|
||||
b0 ORER - Overrun error detect : clear */
|
||||
|
||||
|
@ -277,6 +275,10 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
|
|||
uart_data[obj->index].sw_rts.pin = NC;
|
||||
uart_data[obj->index].sw_cts.pin = NC;
|
||||
|
||||
/* ---- Serial control register (SCSCR) setting ---- */
|
||||
/* Setting the TE and RE bits enables the TxD and RxD pins to be used. */
|
||||
obj->uart->SCSCR = 0x00F0;
|
||||
|
||||
is_stdio_uart = (uart == STDIO_UART) ? (1) : (0);
|
||||
|
||||
if (is_stdio_uart) {
|
||||
|
|
Loading…
Reference in New Issue