1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

Added progressbar (from wiring)

This commit is contained in:
Cristian Maglie
2011-08-16 19:52:31 +02:00
parent 4c73aaf186
commit 42943b4de3
4 changed files with 102 additions and 5 deletions

View File

@ -111,6 +111,7 @@ public class Compiler implements MessageConsumer {
// 0. include paths for core + all libraries
sketch.setCompilingProgress(20);
List includePaths = new ArrayList();
includePaths.add(corePath);
if (pinsPath != null) includePaths.add(pinsPath);
@ -120,6 +121,7 @@ public class Compiler implements MessageConsumer {
// 1. compile the sketch (already in the buildPath)
sketch.setCompilingProgress(30);
objectFiles.addAll(
compileFiles(avrBasePath, buildPath, includePaths,
findFilesInPath(buildPath, "S", false),
@ -129,6 +131,7 @@ public class Compiler implements MessageConsumer {
// 2. compile the libraries, outputting .o files to: <buildPath>/<library>/
sketch.setCompilingProgress(40);
for (File libraryFolder : sketch.getImportedLibraries()) {
File outputFolder = new File(buildPath, libraryFolder.getName());
File utilityFolder = new File(libraryFolder, "utility");
@ -156,6 +159,7 @@ public class Compiler implements MessageConsumer {
// 3. compile the core, outputting .o files to <buildPath> and then
// collecting them into the core.a library file.
sketch.setCompilingProgress(50);
includePaths.clear();
includePaths.add(corePath); // include path for core only
if (pinsPath != null) includePaths.add(pinsPath);
@ -180,6 +184,7 @@ public class Compiler implements MessageConsumer {
// 4. link it all together into the .elf file
sketch.setCompilingProgress(60);
List baseCommandLinker = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-gcc",
"-Os",
@ -208,6 +213,7 @@ public class Compiler implements MessageConsumer {
List commandObjcopy;
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
sketch.setCompilingProgress(70);
commandObjcopy = new ArrayList(baseCommandObjcopy);
commandObjcopy.add(2, "ihex");
commandObjcopy.set(3, "-j");
@ -221,6 +227,7 @@ public class Compiler implements MessageConsumer {
execAsynchronously(commandObjcopy);
// 6. build the .hex file
sketch.setCompilingProgress(80);
commandObjcopy = new ArrayList(baseCommandObjcopy);
commandObjcopy.add(2, "ihex");
commandObjcopy.add(".eeprom"); // remove eeprom data
@ -228,6 +235,8 @@ public class Compiler implements MessageConsumer {
commandObjcopy.add(buildPath + File.separator + primaryClassName + ".hex");
execAsynchronously(commandObjcopy);
sketch.setCompilingProgress(90);
return true;
}