mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
parent
93578cef42
commit
2ddbf01334
@ -94,13 +94,23 @@ public class SerialBoardsLister extends TimerTask {
|
||||
for (String newPort : ports) {
|
||||
|
||||
String[] parts = newPort.split("_");
|
||||
String port = parts[0];
|
||||
|
||||
if (parts.length != 3) {
|
||||
if (parts.length < 3) {
|
||||
// something went horribly wrong
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parts.length > 3) {
|
||||
// port name with _ in it (like CP2102 on OSX)
|
||||
for (int i = 1; i < (parts.length-2); i++) {
|
||||
parts[0] += "_" + parts[i];
|
||||
}
|
||||
parts[1] = parts[parts.length-2];
|
||||
parts[2] = parts[parts.length-1];
|
||||
}
|
||||
|
||||
String port = parts[0];
|
||||
|
||||
Map<String, Object> boardData = platform.resolveDeviceByVendorIdProductId(port, BaseNoGui.packages);
|
||||
|
||||
BoardPort boardPort = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user