Skip to content

Commit dec06c0

Browse files
author
Federico Fissore
committed
Merge remote-tracking branch 'arduino/ide-1.5.x' into dev-ide-1.5.x-discovery
2 parents 803ad2f + c70cba8 commit dec06c0

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

app/src/cc/arduino/packages/uploaders/SerialUploader.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
4949
TargetPlatform targetPlatform = Base.getTargetPlatform();
5050
PreferencesMap prefs = Preferences.getMap();
5151
prefs.putAll(Base.getBoardPreferences());
52-
prefs.putAll(targetPlatform.getTool(prefs.getOrExcept("upload.tool")));
52+
String tool = prefs.getOrExcept("upload.tool");
53+
if (tool.contains(":")) {
54+
String[] split = tool.split(":", 2);
55+
targetPlatform = Base.getCurrentTargetPlatformFromPackage(split[0]);
56+
tool = split[1];
57+
}
58+
prefs.putAll(targetPlatform.getTool(tool));
5359

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

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
*/
2424
package processing.app.debug;
2525

26+
import static processing.app.I18n._;
27+
2628
import java.io.File;
2729
import java.util.Collection;
2830
import java.util.LinkedHashMap;
2931
import java.util.Map;
3032

33+
import processing.app.I18n;
3134
import processing.app.helpers.filefilters.OnlyDirs;
3235

3336
public class TargetPackage {
@@ -47,8 +50,18 @@ public TargetPackage(String _id, File _folder) throws TargetPlatformException {
4750
if (!subFolder.exists() || !subFolder.canRead())
4851
continue;
4952
String arch = subFolder.getName();
50-
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
51-
platforms.put(arch, platform);
53+
try {
54+
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
55+
platforms.put(arch, platform);
56+
} catch (TargetPlatformException e) {
57+
System.out.println(e.getMessage());
58+
}
59+
}
60+
61+
if (platforms.size() == 0) {
62+
throw new TargetPlatformException(I18n
63+
.format(_("No valid hardware definitions found in folder {0}."),
64+
_folder.getName()));
5265
}
5366
}
5467

0 commit comments

Comments
 (0)