Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2762fe6

Browse files
projectgusdpgeorge
authored andcommitted
tests/serial_test.py: Allow up to 2 seconds between bytes.
Only a problem when UART TX is also enabled and goes first (i.e. esp32port) as sending 16384 bytes in one go triggers the timeout.This work was funded through GitHub Sponsors.Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent10b7dfd commit2762fe6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎tests/serial_test.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def read_test(ser_repl, ser_data, bufsize, nbuf):
103103

104104
assertbufsize%256==0# for verify to work
105105

106+
# how long to wait for data from device
107+
# (if UART TX is also enabled then it can take 1.4s to send
108+
# out a 16KB butter at 115200bps)
109+
READ_TIMEOUT_S=2
110+
106111
# Load and run the read_test_script.
107112
ser_repl.write(b"\x03\x01\x04")# break, raw-repl, soft-reboot
108113
drain_input(ser_repl)
@@ -121,7 +126,7 @@ def read_test(ser_repl, ser_data, bufsize, nbuf):
121126
whileremain:
122127
t0=time.monotonic_ns()
123128
whileser_data.inWaiting()==0:
124-
iftime.monotonic_ns()-t0>1e9:
129+
iftime.monotonic_ns()-t0>READ_TIMEOUT_S*1e9:
125130
# timeout waiting for data from device
126131
break
127132
time.sleep(0.0001)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp