Skip to content

Commit 114e70e

Browse files
committed
vcu118-run.py: Don't depend on endpoint iteration order for TTY
The documentation explicitly states there is no order, so make sure we pick up the right TTY from the dual port UART. On tiger this seems to be getting them backwards.
1 parent 24ebf4e commit 114e70e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vcu118-run.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,19 @@ def find_vcu118_tty(pretend: bool) -> ListPortInfo:
440440
# find the serial port:
441441
expected_vendor_id = 0x10C4
442442
expected_product_id = 0xEA70
443+
expected_endpoint = ":1.1"
443444
for portinfo in comports(include_links=True):
444445
assert isinstance(portinfo, ListPortInfo)
445-
if portinfo.pid == expected_product_id and portinfo.vid == expected_vendor_id:
446+
if (
447+
portinfo.pid == expected_product_id
448+
and portinfo.vid == expected_vendor_id
449+
and portinfo.location.endswith(expected_endpoint)
450+
):
446451
return portinfo
447452
if pretend:
448453
return ListPortInfo("/dev/fakeTTY")
449-
raise ValueError("Could not find USB TTY with VID", hex(expected_vendor_id), "PID", hex(expected_product_id))
454+
raise ValueError("Could not find USB TTY with VID", hex(expected_vendor_id), "PID", hex(expected_product_id),
455+
"endpoint", expected_endpoint)
450456

451457

452458
def main():

0 commit comments

Comments
 (0)