Skip to content

Commit

Permalink
Add second output recipe, to save .elf file
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Aug 24, 2015
1 parent 80ad56c commit 0bd6f01
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arduino-core/src/processing/app/debug/Compiler.java
Expand Up @@ -1266,6 +1266,22 @@ void saveHex() throws RunnerException {
} catch (Exception e) {
throw new RunnerException(e);
}

if (prefs.containsKey("recipe.output.tmp_file2") && prefs.containsKey("recipe.output.save_file2")) {
try {
String compiledSketch = prefs.getOrExcept("recipe.output.tmp_file2");
compiledSketch = StringReplacer.replaceFromMapping(compiledSketch, dict);
String copyOfCompiledSketch = prefs.getOrExcept("recipe.output.save_file2");
copyOfCompiledSketch = StringReplacer.replaceFromMapping(copyOfCompiledSketch, dict);

File compiledSketchFile = new File(prefs.get("build.path"), compiledSketch);
File copyOfCompiledSketchFile = new File(sketch.getFolder(), copyOfCompiledSketch);

FileUtils.copyFile(compiledSketchFile, copyOfCompiledSketchFile);
} catch (Exception e) {
throw new RunnerException(e);
}
}
}


Expand Down

0 comments on commit 0bd6f01

Please sign in to comment.