rp2/machine_uart: Make it so TX is done only when no longer busy.
Prior to this commit, when flushing a UART on the rp2 port, it returns just before the last character is sent out the wire. Fix this by waiting until the BUSY flag is cleared. This also fixes the behaviour of `UART.txdone()` to return `True` only when the last byte has gone out. Updated docs and tests to match. The test now checks that UART TX time is very close to the expected time (prior, it was just testing that the TX time was less than the expected time). Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -160,7 +160,7 @@ Methods
|
||||
|
||||
.. note::
|
||||
|
||||
For the rp2, esp8266 and nrf ports the call returns while the last byte is sent.
|
||||
For the esp8266 and nrf ports the call returns while the last byte is sent.
|
||||
If required, a one character wait time has to be added in the calling script.
|
||||
|
||||
Availability: rp2, esp32, esp8266, mimxrt, cc3200, stm32, nrf ports, renesas-ra
|
||||
@@ -172,7 +172,7 @@ Methods
|
||||
|
||||
.. note::
|
||||
|
||||
For the rp2, esp8266 and nrf ports the call may return ``True`` even if the last byte
|
||||
For the esp8266 and nrf ports the call may return ``True`` even if the last byte
|
||||
of a transfer is still being sent. If required, a one character wait time has to be
|
||||
added in the calling script.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user