Skip to content

Commit b8c795e

Browse files
committed
Don't give up when loading hardware/ profile directories with some invalid directories
This allows you to create hardware profiles that support both pre-1.5 and 1.5 onwards (boards.txt, cores, bootloader etc. in root for pre-1.5 and <architecture>/ directories containing 1.5 onward content. Still prints a warning if a hardware folder doesn't contain anything 1.5 compatible.
1 parent 7959d85 commit b8c795e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

+10-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ public TargetPackage(String _id, File _folder) throws TargetPlatformException {
4747
if (!subFolder.exists() || !subFolder.canRead())
4848
continue;
4949
String arch = subFolder.getName();
50-
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
51-
platforms.put(arch, platform);
50+
try {
51+
TargetPlatform platform = new TargetPlatform(arch, subFolder, this);
52+
platforms.put(arch, platform);
53+
} catch (TargetPlatformException e) {
54+
continue;
55+
}
56+
}
57+
58+
if(platforms.size() == 0) {
59+
throw new TargetPlatformException("No architecture directories with boards.txt files were found in hardware folder " + _folder.getName() + ". Is it pre-1.5?");
5260
}
5361
}
5462

0 commit comments

Comments
 (0)