mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
Compiler: removed duplicated functions compileEep and compileHex in favour of generic runRecipe
This commit is contained in:
@ -401,11 +401,11 @@ public class Compiler implements MessageConsumer {
|
|||||||
|
|
||||||
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
|
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
|
||||||
progressListener.progress(70);
|
progressListener.progress(70);
|
||||||
compileEep();
|
runRecipe("recipe.objcopy.eep.pattern");
|
||||||
|
|
||||||
// 6. build the .hex file
|
// 6. build the .hex file
|
||||||
progressListener.progress(80);
|
progressListener.progress(80);
|
||||||
compileHex();
|
runRecipe("recipe.objcopy.hex.pattern");
|
||||||
|
|
||||||
progressListener.progress(90);
|
progressListener.progress(90);
|
||||||
return true;
|
return true;
|
||||||
@ -1069,28 +1069,12 @@ public class Compiler implements MessageConsumer {
|
|||||||
execAsynchronously(cmdArray);
|
execAsynchronously(cmdArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
|
void runRecipe(String recipe) throws RunnerException, PreferencesMapException {
|
||||||
void compileEep() throws RunnerException, PreferencesMapException {
|
|
||||||
PreferencesMap dict = new PreferencesMap(prefs);
|
PreferencesMap dict = new PreferencesMap(prefs);
|
||||||
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
||||||
|
|
||||||
String[] cmdArray;
|
String[] cmdArray;
|
||||||
String cmd = prefs.getOrExcept("recipe.objcopy.eep.pattern");
|
String cmd = prefs.getOrExcept(recipe);
|
||||||
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");
|
|
||||||
try {
|
try {
|
||||||
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
|
cmdArray = StringReplacer.formatAndSplit(cmd, dict, true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Reference in New Issue
Block a user