1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-10 21:24:12 +01:00

Compiler: don't merge if bootloader file is specified but missing. Print a warning instead. Fixes #3394

This commit is contained in:
Federico Fissore 2015-06-22 11:11:09 +02:00
parent 8e76fb87dc
commit 978c8fc682

View File

@ -1198,15 +1198,19 @@ public class Compiler implements MessageConsumer {
return null; return null;
} }
File mergedSketch = new File(buildPath, className + ".with_bootloader.hex");
FileUtils.copyFile(sketch, mergedSketch);
String bootloaderNoBlink = prefs.get("bootloader.noblink"); String bootloaderNoBlink = prefs.get("bootloader.noblink");
if (bootloaderNoBlink == null) { if (bootloaderNoBlink == null) {
bootloaderNoBlink = prefs.get("bootloader.file"); bootloaderNoBlink = prefs.get("bootloader.file");
} }
File bootloader = new File(new File(prefs.get("build.platform.path"), "bootloaders"), bootloaderNoBlink); File bootloader = new File(new File(prefs.get("build.platform.path"), "bootloaders"), bootloaderNoBlink);
if (!bootloader.exists()) {
System.err.println(I18n.format(_("Bootloader file specified but missing: {0}"), bootloader));
return null;
}
File mergedSketch = new File(buildPath, className + ".with_bootloader.hex");
FileUtils.copyFile(sketch, mergedSketch);
new MergeSketchWithBooloader().merge(mergedSketch, bootloader); new MergeSketchWithBooloader().merge(mergedSketch, bootloader);