mirror of https://github.com/ARMmbed/mbed-os.git
Remove byte sent at 9600 baud on init on NRF51-DK
Disconnect the TX line before sending a dummy byte, and wait until the dummy byte is completely sent before continuing. This prevents the byte from getting sent on init or re-init of the uart.pull/1474/head
parent
48fa2930e5
commit
8d12e206f6
|
@ -77,7 +77,10 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
|
|||
obj->uart->EVENTS_RXDRDY = 0;
|
||||
// dummy write needed or TXDRDY trails write rather than leads write.
|
||||
// pins are disconnected so nothing is physically transmitted on the wire
|
||||
obj->uart->PSELTXD = 0xFFFFFFFF;
|
||||
obj->uart->EVENTS_TXDRDY = 0;
|
||||
obj->uart->TXD = 0;
|
||||
while (obj->uart->EVENTS_TXDRDY != 1);
|
||||
|
||||
obj->index = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue