aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorsago35 <[email protected]>2022-08-24 21:42:41 +0900
committerRon Evans <[email protected]>2022-08-24 19:42:49 +0200
commit303410d3fcfcf3df45bfe6c927a5b963caf3a394 (patch)
tree0422acdff399a8a337c5e84338d27b85fb396bec
parentaa13b5d83bc7d43db7197c2c1ebfb0cf32b81736 (diff)
downloadtinygo-303410d3fcfcf3df45bfe6c927a5b963caf3a394.tar.gz
tinygo-303410d3fcfcf3df45bfe6c927a5b963caf3a394.zip
main: ignore ports with VID/PID if not candidates
-rw-r--r--main.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/main.go b/main.go
index e3b6d6444..9addc7748 100644
--- a/main.go
+++ b/main.go
@@ -978,8 +978,7 @@ func getDefaultPort(portFlag string, usbInterfaces []string) (port string, err e
preferredPortIDs = append(preferredPortIDs, [2]uint16{uint16(vid), uint16(pid)})
}
- var primaryPorts []string // ports picked from preferred USB VID/PID
- var secondaryPorts []string // other ports (as a fallback)
+ var primaryPorts []string // ports picked from preferred USB VID/PID
for _, p := range portsList {
if !p.IsUSB {
continue
@@ -1001,8 +1000,6 @@ func getDefaultPort(portFlag string, usbInterfaces []string) (port string, err e
continue
}
}
-
- secondaryPorts = append(secondaryPorts, p.Name)
}
if len(primaryPorts) == 1 {
// There is exactly one match in the set of preferred ports. Use
@@ -1014,10 +1011,6 @@ func getDefaultPort(portFlag string, usbInterfaces []string) (port string, err e
// one device of the same type are connected (e.g. two Arduino
// Unos).
ports = primaryPorts
- } else {
- // No preferred ports found. Fall back to other serial ports
- // available in the system.
- ports = secondaryPorts
}
if len(ports) == 0 {