diff --git a/docs b/docs index a57afb02..30e2c2d6 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit a57afb023af0b3adbe6cc1bbff2cf287d9e02b0f +Subproject commit 30e2c2d667560920f891d25bb51bad4e0c74d620 diff --git a/examples b/examples index c328c386..3aa5ced9 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit c328c386fe8427b31562196cd3a989b08df03e05 +Subproject commit 3aa5ced9414f34d3c5f556dd66c8fdd85b4125be diff --git a/platformio/device/serial.py b/platformio/device/serial.py index 2d9a2f7b..6d32e139 100644 --- a/platformio/device/serial.py +++ b/platformio/device/serial.py @@ -50,15 +50,15 @@ def scan_serial_port( if 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(): if ensure_ready and not is_serial_port_ready(item["port"]): continue port = item["port"] if "VID:PID" in item["hwid"]: - return port - - return port + usb_port = port + return usb_port or port def match_serial_port(pattern):