From a6bf2bb5677b3fa4da22c3d38fd8c7c0029541b1 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 11 Mar 2013 19:59:15 +0100 Subject: [PATCH] Another update on the way burnBootloader builds its configuration. See #1038 #1176 --- .../processing/app/debug/BasicUploader.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/debug/BasicUploader.java b/app/src/processing/app/debug/BasicUploader.java index 685165c48..1909c464a 100644 --- a/app/src/processing/app/debug/BasicUploader.java +++ b/app/src/processing/app/debug/BasicUploader.java @@ -270,12 +270,25 @@ public class BasicUploader extends Uploader { prefs.putAll(Base.getBoardPreferences()); prefs.putAll(programmerPrefs); - // Add configuration for bootloader tool - String toolName = prefs.get("bootloader.tool"); - PreferencesMap toolPrefs = targetPlatform.getTool(toolName); + // Create configuration for bootloader tool + PreferencesMap toolPrefs = new PreferencesMap(); + String tool = prefs.get("bootloader.tool"); + if (tool.contains(":")) { + String[] split = tool.split(":", 2); + TargetPlatform platform = Base.getCurrentTargetPlatformFromPackage(split[0]); + tool = split[1]; + toolPrefs.putAll(platform.getTool(tool)); + if (toolPrefs.size() == 0) + throw new RunnerException( + I18n.format(_("Could not find tool {0} from package {1}"), tool, + split[0])); + } + toolPrefs.putAll(targetPlatform.getTool(tool)); if (toolPrefs.size() == 0) throw new RunnerException(I18n.format(_("Could not find tool {0}"), - toolName)); + tool)); + + // Merge tool with global configuration prefs.putAll(toolPrefs); if (verbose) { prefs.put("erase.verbose", prefs.get("erase.params.verbose"));