Skip to content

Commit 3a68385

Browse files
committed
Merge branch 'ide-1.5.x-thirdpartyboardprofiles' of github.com:projectgus/Arduino into projectgus-ide-1.5.x-thirdpartyboardprofiles
Conflicts: app/src/processing/app/debug/BasicUploader.java
2 parents 65c36f2 + b8c795e commit 3a68385

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

app/src/processing/app/debug/BasicUploader.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ public boolean uploadUsingPreferences(String buildPath, String className,
5151
TargetPlatform targetPlatform = Base.getTargetPlatform();
5252
PreferencesMap prefs = Preferences.getMap();
5353
prefs.putAll(Base.getBoardPreferences());
54-
prefs.putAll(targetPlatform.getTool(prefs.getOrExcept("upload.tool")));
54+
String tool = prefs.getOrExcept("upload.tool");
55+
if (tool.contains(":")) {
56+
String[] split = tool.split(":", 2);
57+
targetPlatform = Base.getCurrentTargetPlatformFromPackage(split[0]);
58+
tool = split[1];
59+
}
60+
prefs.putAll(targetPlatform.getTool(tool));
5561

5662
// if no protocol is specified for this board, assume it lacks a
5763
// bootloader and upload using the selected programmer.

app/src/processing/app/debug/TargetPackage.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ public TargetPackage(String _id, File _folder) throws TargetPlatformException {
4747
if (!subFolder.exists() || !subFolder.canRead())
4848
continue;
4949
String arch = subFolder.getName();
50-
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
51-
platforms.put(arch, platform);
50+
try {
51+
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
52+
platforms.put(arch, platform);
53+
} catch (TargetPlatformException e) {
54+
continue;
55+
}
56+
}
57+
58+
if(platforms.size() == 0) {
59+
throw new TargetPlatformException("No architecture directories with boards.txt files were found in hardware folder " + _folder.getName() + ". Is it pre-1.5?");
5260
}
5361
}
5462

0 commit comments

Comments
 (0)