Skip to content

Commit a6bf2bb

Browse files
committed
Another update on the way burnBootloader builds its configuration.
See arduino#1038 arduino#1176
1 parent 8ef2fe3 commit a6bf2bb

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

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

+17-4
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,25 @@ public boolean burnBootloader() throws RunnerException {
270270
prefs.putAll(Base.getBoardPreferences());
271271
prefs.putAll(programmerPrefs);
272272

273-
// Add configuration for bootloader tool
274-
String toolName = prefs.get("bootloader.tool");
275-
PreferencesMap toolPrefs = targetPlatform.getTool(toolName);
273+
// Create configuration for bootloader tool
274+
PreferencesMap toolPrefs = new PreferencesMap();
275+
String tool = prefs.get("bootloader.tool");
276+
if (tool.contains(":")) {
277+
String[] split = tool.split(":", 2);
278+
TargetPlatform platform = Base.getCurrentTargetPlatformFromPackage(split[0]);
279+
tool = split[1];
280+
toolPrefs.putAll(platform.getTool(tool));
281+
if (toolPrefs.size() == 0)
282+
throw new RunnerException(
283+
I18n.format(_("Could not find tool {0} from package {1}"), tool,
284+
split[0]));
285+
}
286+
toolPrefs.putAll(targetPlatform.getTool(tool));
276287
if (toolPrefs.size() == 0)
277288
throw new RunnerException(I18n.format(_("Could not find tool {0}"),
278-
toolName));
289+
tool));
290+
291+
// Merge tool with global configuration
279292
prefs.putAll(toolPrefs);
280293
if (verbose) {
281294
prefs.put("erase.verbose", prefs.get("erase.params.verbose"));

0 commit comments

Comments
 (0)