diff options
author | Damien George <damien@micropython.org> | 2024-10-21 16:32:24 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-10-22 10:17:05 +1100 |
commit | 97af1001ae07c573bf432b9923dcdf78055a508c (patch) | |
tree | 55fb7563b75ec1f199957f4b0856033a390b566b /docs/library/machine.UART.rst | |
parent | 1b89c503db690967d50699abe0bfa942f6f6b15e (diff) | |
download | micropython-97af1001ae07c573bf432b9923dcdf78055a508c.tar.gz micropython-97af1001ae07c573bf432b9923dcdf78055a508c.zip |
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>
Diffstat (limited to 'docs/library/machine.UART.rst')
-rw-r--r-- | docs/library/machine.UART.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/library/machine.UART.rst b/docs/library/machine.UART.rst index 0f3e77ec47..4dcb4a1e7c 100644 --- a/docs/library/machine.UART.rst +++ b/docs/library/machine.UART.rst @@ -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. |