Skip to content

Commit 54d2e2d

Browse files
author
Massimiliano Pippi
authored
add detected port even if the board couldn't be recognized (#411)
1 parent de85187 commit 54d2e2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: commands/board/list.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,16 @@ func List(instanceID int32) ([]*rpc.DetectedPort, error) {
115115
port.IdentificationPrefs.Get("pid"))
116116
items, err := apiByVidPid(url)
117117
if err == ErrNotFound {
118-
// the board couldn't be detected, keep going with the next port
118+
// the board couldn't be detected, print a warning
119119
logrus.Debug("Board not recognized")
120-
continue
121120
} else if err != nil {
122121
// this is bad, bail out
123122
return nil, errors.Wrap(err, "error getting board info from Arduino Cloud")
124123
}
125124

125+
// add a DetectedPort entry in any case: the `Boards` field will
126+
// be empty but the port will be shown anyways (useful for 3rd party
127+
// boards)
126128
b = items
127129
}
128130

0 commit comments

Comments
 (0)