tests/extmod_hardware/machine_uart_irq_break.py: Remove send_uart.
This is no longer needed, the esp32 port can now pass this test using just a single UART. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
79b2d4ff22
commit
1ab1f857b3
1 changed files with 12 additions and 22 deletions
|
|
@ -19,18 +19,13 @@ if "esp32" in sys.platform:
|
||||||
if "ESP32S2" in _machine or "ESP32C3" in _machine or "ESP32C6" in _machine:
|
if "ESP32S2" in _machine or "ESP32C3" in _machine or "ESP32C6" in _machine:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
# ESP32 needs separate UART instances for the test
|
uart_id = 1
|
||||||
recv_uart_id = 1
|
tx_pin = 4
|
||||||
recv_tx_pin = 14
|
rx_pin = 5
|
||||||
recv_rx_pin = 5
|
|
||||||
send_uart_id = 2
|
|
||||||
send_tx_pin = 4
|
|
||||||
send_rx_pin = 12
|
|
||||||
elif "rp2" in sys.platform:
|
elif "rp2" in sys.platform:
|
||||||
recv_uart_id = 0
|
uart_id = 0
|
||||||
send_uart_id = 0
|
tx_pin = "GPIO0"
|
||||||
recv_tx_pin = "GPIO0"
|
rx_pin = "GPIO1"
|
||||||
recv_rx_pin = "GPIO1"
|
|
||||||
else:
|
else:
|
||||||
print("Please add support for this test on this platform.")
|
print("Please add support for this test on this platform.")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
@ -42,22 +37,17 @@ def irq(u):
|
||||||
|
|
||||||
# Test that the IRQ is called for each break received.
|
# Test that the IRQ is called for each break received.
|
||||||
for bits_per_s in (2400, 9600, 57600):
|
for bits_per_s in (2400, 9600, 57600):
|
||||||
recv_uart = UART(recv_uart_id, bits_per_s, tx=recv_tx_pin, rx=recv_rx_pin)
|
uart = UART(uart_id, bits_per_s, tx=tx_pin, rx=rx_pin)
|
||||||
if recv_uart_id != send_uart_id:
|
uart.irq(irq, uart.IRQ_BREAK)
|
||||||
send_uart = UART(send_uart_id, bits_per_s, tx=send_tx_pin, rx=send_rx_pin)
|
|
||||||
else:
|
|
||||||
send_uart = recv_uart
|
|
||||||
|
|
||||||
recv_uart.irq(irq, recv_uart.IRQ_BREAK)
|
|
||||||
|
|
||||||
print("write", bits_per_s)
|
print("write", bits_per_s)
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
send_uart.write(str(i))
|
uart.write(str(i))
|
||||||
send_uart.flush()
|
uart.flush()
|
||||||
time.sleep_ms(10)
|
time.sleep_ms(10)
|
||||||
send_uart.sendbreak()
|
uart.sendbreak()
|
||||||
time.sleep_ms(10)
|
time.sleep_ms(10)
|
||||||
if "esp32" in sys.platform:
|
if "esp32" in sys.platform:
|
||||||
# On esp32 a read is needed to read in the break byte.
|
# On esp32 a read is needed to read in the break byte.
|
||||||
recv_uart.read()
|
uart.read()
|
||||||
print("done")
|
print("done")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue