mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
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:
committed by
Ron Evans
parent
8e88f3e76a
commit
c153239682
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user