Allow uploader choice in upload.tool to specify a different platform vendor

This commit is contained in:
Angus Gratton 2013-05-17 12:09:05 +10:00
parent 76fd163a5f
commit 7959d85dd4
1 changed files with 7 additions and 1 deletions

View File

@ -50,7 +50,13 @@ public class BasicUploader extends Uploader {
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.