1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Compiler: removed duplicated functions compileEep and compileHex in favour of generic runRecipe

This commit is contained in:
Federico Fissore 2015-01-08 13:49:51 +01:00
parent 980709f6f7
commit f5520fc7e1

View File

@ -401,11 +401,11 @@ public class Compiler implements MessageConsumer {
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
progressListener.progress(70);
compileEep();
runRecipe("recipe.objcopy.eep.pattern");
// 6. build the .hex file
progressListener.progress(80);
compileHex();
runRecipe("recipe.objcopy.hex.pattern");
progressListener.progress(90);
return true;
@ -1069,28 +1069,12 @@ public class Compiler implements MessageConsumer {
execAsynchronously(cmdArray);
}
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
void compileEep() throws RunnerException, PreferencesMapException {
void runRecipe(String recipe) throws RunnerException, PreferencesMapException {
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + BaseNoGui.REVISION);
String[] cmdArray;
String cmd = prefs.getOrExcept("recipe.objcopy.eep.pattern");
try {
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
} catch (Exception e) {
throw new RunnerException(e);
}
execAsynchronously(cmdArray);
}
// 6. build the .hex file
void compileHex() throws RunnerException, PreferencesMapException {
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + BaseNoGui.REVISION);
String[] cmdArray;
String cmd = prefs.getOrExcept("recipe.objcopy.hex.pattern");
String cmd = prefs.getOrExcept(recipe);
try {
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
} catch (Exception e) {