diff options
author | robert-hh <robert@hammelrath.com> | 2024-08-29 12:10:32 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-09-06 17:43:49 +1000 |
commit | e23fdb1f7714bc1707ae9c5936a6c219ffb3044c (patch) | |
tree | a2aecc8f85f2bc8939566dcf76010627e4b996bc /tests/extmod/machine_uart_irq_txidle.py | |
parent | 1a6279ba37678893db9f2756fceaa5c817cae888 (diff) |
tests/extmod/machine_uart_irq_txidle.py: Simplify the test script.
Now that no minimal delay time is required for SAMD devices.
Signed-off-by: robert-hh <robert@hammelrath.com>
Diffstat (limited to 'tests/extmod/machine_uart_irq_txidle.py')
-rw-r--r-- | tests/extmod/machine_uart_irq_txidle.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/extmod/machine_uart_irq_txidle.py b/tests/extmod/machine_uart_irq_txidle.py index 3e69bb431..feb95faba 100644 --- a/tests/extmod/machine_uart_irq_txidle.py +++ b/tests/extmod/machine_uart_irq_txidle.py @@ -16,27 +16,20 @@ if "rp2" in sys.platform: uart_id = 0 tx_pin = "GPIO0" rx_pin = "GPIO1" - min_window = 1 elif "samd" in sys.platform and "ItsyBitsy M0" in sys.implementation._machine: uart_id = 0 tx_pin = "D1" rx_pin = "D0" - # For SAMD delay_ms has to be used for the trailing window, and the - # mininmal time is 11 ms to allow for scheduling. - min_window = 11 elif "samd" in sys.platform and "ItsyBitsy M4" in sys.implementation._machine: uart_id = 3 tx_pin = "D1" rx_pin = "D0" - min_window = 11 elif "mimxrt" in sys.platform: uart_id = 1 tx_pin = None - min_window = 0 elif "nrf" in sys.platform: uart_id = 0 tx_pin = None - min_window = 0 else: print("Please add support for this test on this platform.") raise SystemExit @@ -61,12 +54,11 @@ for bits_per_s in (2400, 9600, 115200): # the test marks a time window close to the expected of the sending # and the time at which the IRQ should have been fired. # It is just a rough estimation of 10 characters before and - # 20 characters after the data's end, unless there is a need to - # wait a minimal time, like for SAMD devices. + # 20 characters after the data's end. bits_per_char = 10 # 1(startbit) + 8(bits) + 1(stopbit) + 0(parity) start_time_us = (len(text) - 10) * bits_per_char * 1_000_000 // bits_per_s - window_ms = max(min_window, 20 * bits_per_char * 1_000 // bits_per_s + 1) + window_ms = 20 * bits_per_char * 1_000 // bits_per_s + 1 print("write", bits_per_s) uart.write(text) |