Skip to content

Third party board profiles in 1.5 #1423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/src/processing/app/debug/BasicUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ public boolean uploadUsingPreferences(String buildPath, String className,
TargetPlatform targetPlatform = Base.getTargetPlatform();
PreferencesMap prefs = Preferences.getMap();
prefs.putAll(Base.getBoardPreferences());
prefs.putAll(targetPlatform.getTool(prefs.get("upload.tool")));
String tool = prefs.get("upload.tool");
if (tool.contains(":")) {
String[] split = tool.split(":", 2);
targetPlatform = Base.getCurrentTargetPlatformFromPackage(split[0]);
tool = split[1];
}
prefs.putAll(targetPlatform.getTool(tool));

// if no protocol is specified for this board, assume it lacks a
// bootloader and upload using the selected programmer.
Expand Down
12 changes: 10 additions & 2 deletions app/src/processing/app/debug/TargetPackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@ public TargetPackage(String _id, File _folder) throws TargetPlatformException {
if (!subFolder.exists() || !subFolder.canRead())
continue;
String arch = subFolder.getName();
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
platforms.put(arch, platform);
try {
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
platforms.put(arch, platform);
} catch (TargetPlatformException e) {
continue;
}
}

if(platforms.size() == 0) {
throw new TargetPlatformException("No architecture directories with boards.txt files were found in hardware folder " + _folder.getName() + ". Is it pre-1.5?");
}
}

Expand Down