diff options
author | Ron Evans <[email protected]> | 2023-04-25 15:50:06 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-04-25 18:18:23 +0200 |
commit | 76303f9db4d97834dcd7035ba3cfc88aad8a1316 (patch) | |
tree | 7030cd360af69d2a592c27f064c64d114dc6bbf0 /main.go | |
parent | 4bf8b618e5f5301f38b4b0e75da77add37eaac55 (diff) | |
download | tinygo-76303f9db4d97834dcd7035ba3cfc88aad8a1316.tar.gz tinygo-76303f9db4d97834dcd7035ba3cfc88aad8a1316.zip |
Revert "all: better errors when multiple mcus share VID/PID"
This reverts commit af9f19615bb2f79d29a9cfaa1088890fbc154aad.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1143,12 +1143,12 @@ func getDefaultPort(portFlag string, usbInterfaces []string) (port string, err e } if len(portCandidates) == 0 { - if len(ports) == 1 { + if len(usbInterfaces) > 0 { + return "", errors.New("unable to search for a default USB device - use -port flag, available ports are " + strings.Join(ports, ", ")) + } else if len(ports) == 1 { return ports[0], nil - } else if len(ports) > 1 { - return "", errors.New("multiple serial ports available - use -port flag, available ports are " + strings.Join(ports, ", ")) } else { - return "", errors.New("unable to search for a default USB device - use -port flag, available ports are " + strings.Join(ports, ", ")) + return "", errors.New("multiple serial ports available - use -port flag, available ports are " + strings.Join(ports, ", ")) } } |