mirror of
https://github.com/espressif/esptool.git
synced 2025-10-14 19:28:40 +08:00
fix: USB-JTAG-Serial PID detection error
This commit is contained in:
@@ -494,12 +494,14 @@ class ESPLoader(object):
|
||||
if active_port.startswith("/dev/") and os.path.islink(active_port):
|
||||
active_port = os.path.realpath(active_port)
|
||||
|
||||
active_ports = [active_port]
|
||||
|
||||
# The "cu" (call-up) device has to be used for outgoing communication on MacOS
|
||||
if sys.platform == "darwin" and "tty" in active_port:
|
||||
active_port = [active_port, active_port.replace("tty", "cu")]
|
||||
active_ports.append(active_port.replace("tty", "cu"))
|
||||
ports = list_ports.comports()
|
||||
for p in ports:
|
||||
if p.device in active_port:
|
||||
if p.device in active_ports:
|
||||
return p.pid
|
||||
print(
|
||||
"\nFailed to get PID of a device on {}, "
|
||||
|
Reference in New Issue
Block a user