forked from platformio/platformio-core
Fix debug port auto-detecting
This commit is contained in:
@ -60,7 +60,6 @@ def AutodetectDebugPort(env):
|
|||||||
return fnmatch(port, pattern)
|
return fnmatch(port, pattern)
|
||||||
|
|
||||||
def _look_for_serial_port(hwids):
|
def _look_for_serial_port(hwids):
|
||||||
port = None
|
|
||||||
for item in util.get_serialports(filter_hwid=True):
|
for item in util.get_serialports(filter_hwid=True):
|
||||||
if not _is_match_pattern(item['port']):
|
if not _is_match_pattern(item['port']):
|
||||||
continue
|
continue
|
||||||
@ -69,8 +68,8 @@ def AutodetectDebugPort(env):
|
|||||||
for hwid in hwids:
|
for hwid in hwids:
|
||||||
hwid_str = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "")
|
hwid_str = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "")
|
||||||
if hwid_str in item['hwid']:
|
if hwid_str in item['hwid']:
|
||||||
return port
|
return item['port']
|
||||||
return port
|
return None
|
||||||
|
|
||||||
if "BOARD" not in env or ("DEBUG_PORT" in env and not _get_pattern()):
|
if "BOARD" not in env or ("DEBUG_PORT" in env and not _get_pattern()):
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user