targets: remove "acm:"` prefix for USB vid/pid pair

This prefix isn't actually used and only adds noise, so remove it.

It may have been useful on Linux that makes a distinction between
/dev/ttyACM* and /dev/ttyUSB* but it isn't now. Also, it's unlikely that
the same vid/pid pair will be shared between an acm and usb driver
anyway.
This commit is contained in:
Ayke van Laethem
2022-09-28 16:24:00 +02:00
committed by Ron Evans
parent 8e88f3e76a
commit c153239682
46 changed files with 47 additions and 51 deletions
+2 -6
View File
@@ -980,12 +980,8 @@ func getDefaultPort(portFlag string, usbInterfaces []string) (port string, err e
var preferredPortIDs [][2]uint16
for _, s := range usbInterfaces {
parts := strings.Split(s, ":")
if len(parts) != 3 || (parts[0] != "acm" && parts[0] == "usb") {
// acm and usb are the two types of serial ports recognized
// under Linux (ttyACM*, ttyUSB*). Other operating systems don't
// generally make this distinction. If this is not one of the
// given USB devices, don't try to parse the USB IDs.
continue
if len(parts) != 2 {
return "", fmt.Errorf("could not parse USB VID/PID pair %q", s)
}
vid, err := strconv.ParseUint(parts[1], 16, 16)
if err != nil {