1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-10-16 22:27:59 +03:00

OSX workaround for board autodetection #223

This commit is contained in:
Federico Fissore
2013-11-08 20:34:05 +01:00
parent c4823ccfc4
commit 0d8e12dbe0
3 changed files with 158 additions and 6 deletions

View File

@@ -52,12 +52,8 @@ public class SystemProfilerParser {
device.put(SERIAL_NUMBER, matcher.group(1));
} else if ((matcher = locationRegex.matcher(line)).matches()) {
String devicePath = devicePrefix;
String suffix = matcher.group(1).substring(2, 6);
try {
devicePath = devicePath + (Integer.parseInt(suffix) + 1);
} catch (NumberFormatException e) {
devicePath = devicePath + suffix + "1";
}
String suffix = matcher.group(1).substring(2, 6).replaceAll("0", "");
devicePath = devicePath + suffix + "1";
device.put(DEVICE_PATH, devicePath);
} else if ((matcher = pidRegex.matcher(line)).matches()) {
device.put(PID, matcher.group(1));