8000 tools/mpremote: Remove non-existent COM0. · micropython/micropython@0ae37a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ae37a4

Browse files
committed
tools/mpremote: Remove non-existent COM0.
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
1 parent c9ec427 commit 0ae37a4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tools/mpremote/mpremote/main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,15 @@ def argparse_none(description):
319319
"--version": "version",
320320
}
321321

322-
# Add "a0", "a1", ..., "u0", "u1", ..., "c0", "c1", ... as aliases
322+
# Add "a0", "a1", ..., "u0", "u1", ..., "c1", "c2", ... as aliases
323323
# for "connect /dev/ttyACMn" (and /dev/ttyUSBn, COMn) etc.
324324
for port_num in range(4):
325325
for prefix, port in [("a", "/dev/ttyACM"), ("u", "/dev/ttyUSB"), ("c", "COM")]:
326-
_BUILTIN_COMMAND_EXPANSIONS["{}{}".format(prefix, port_num)] = {
327-
"command": "connect {}{}".format(port, port_num),
328-
"help": 'connect to serial port "{}{}"'.format(port, port_num),
326+
if port_num == 0 and port == "COM":
327+
continue # skip COM0 as it does not exist
328+
_BUILTIN_COMMAND_EXPANSIONS[f"{prefix}{port_num}"] = {
329+
"command": f"connect {port}{port_num}",
330+
"help": f'connect to serial port "{port}{port_num}"',
329331
}
330332

331333

0 commit comments

Comments
 (0)
0