forked from platformio/platformio-core
Pick the last USB device port
This commit is contained in:
2
docs
2
docs
Submodule docs updated: a57afb023a...30e2c2d667
2
examples
2
examples
Submodule examples updated: c328c386fe...3aa5ced941
@ -50,15 +50,15 @@ def scan_serial_port(
|
|||||||
if port:
|
if port:
|
||||||
return port
|
return port
|
||||||
|
|
||||||
# pick the first PID:VID USB device
|
# pick the last PID:VID USB device
|
||||||
|
usb_port = None
|
||||||
for item in list_serial_ports():
|
for item in list_serial_ports():
|
||||||
if ensure_ready and not is_serial_port_ready(item["port"]):
|
if ensure_ready and not is_serial_port_ready(item["port"]):
|
||||||
continue
|
continue
|
||||||
port = item["port"]
|
port = item["port"]
|
||||||
if "VID:PID" in item["hwid"]:
|
if "VID:PID" in item["hwid"]:
|
||||||
return port
|
usb_port = port
|
||||||
|
return usb_port or port
|
||||||
return port
|
|
||||||
|
|
||||||
|
|
||||||
def match_serial_port(pattern):
|
def match_serial_port(pattern):
|
||||||
|
Reference in New Issue
Block a user