Skip to content

Commit dacfa86

Browse files
committed
Addtional debuggin. Trying to find the pins compile issue.
1 parent 43a11be commit dacfa86

File tree

3 files changed

+27
-30
lines changed

3 files changed

+27
-30
lines changed

app/src/processing/app/debug/Compiler.java

+25-30
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public boolean compile(Sketch sketch,
8080
this.buildPath = buildPath;
8181
this.primaryClassName = primaryClassName;
8282
this.verbose = verbose;
83+
objectFiles = new ArrayList<File>();
8384

8485
// the pms object isn't used for anything but storage
8586
MessageStream pms = new MessageStream(this);
86-
8787
Map<String, String> boardPreferences = Base.getBoardPreferences();
8888

8989
//Check for null platform, and use system default if not found
@@ -164,7 +164,6 @@ public boolean compile(Sketch sketch,
164164
}
165165
}
166166

167-
objectFiles = new ArrayList<File>();
168167

169168
// 0. include paths for core + all libraries
170169

@@ -279,33 +278,10 @@ public boolean compile(Sketch sketch,
279278
// 5. extract EEPROM data (from EEMEM directive) to .eep file.
280279
System.out.println("5. compileEep");
281280
compileEep(avrBasePath, buildPath, includePaths, configPreferences);
282-
283-
/*
284-
commandObjcopy = new ArrayList(baseCommandObjcopy);
285-
commandObjcopy.add(2, "ihex");
286-
commandObjcopy.set(3, "-j");
287-
commandObjcopy.add(".eeprom");
288-
commandObjcopy.add("--set-section-flags=.eeprom=alloc,load");
289-
commandObjcopy.add("--no-change-warnings");
290-
commandObjcopy.add("--change-section-lma");
291-
commandObjcopy.add(".eeprom=0");
292-
commandObjcopy.add(buildPath + File.separator + primaryClassName + ".elf");
293-
commandObjcopy.add(buildPath + File.separator + primaryClassName + ".eep");
294-
execAsynchronously(commandObjcopy);
295-
*/
296281

297282
// 6. build the .hex file
298283
System.out.println("6. compileHex");
299-
compileHex(avrBasePath, buildPath, includePaths, configPreferences);
300-
301-
/*
302-
commandObjcopy = new ArrayList(baseCommandObjcopy);
303-
commandObjcopy.add(2, "ihex");
304-
commandObjcopy.add(".eeprom"); // remove eeprom data
305-
commandObjcopy.add(buildPath + File.separator + primaryClassName + ".elf");
306-
commandObjcopy.add(buildPath + File.separator + primaryClassName + ".hex");
307-
execAsynchronously(commandObjcopy);
308-
*/
284+
compileHex(avrBasePath, buildPath, includePaths, configPreferences);
309285

310286
return true;
311287
}
@@ -534,7 +510,7 @@ static private String[] getCommandCompilerS(String avrBasePath,
534510
configPreferences.get("compiler.cpudef"),
535511
configPreferences.get("build.mcu"),
536512
configPreferences.get("build.f_cpu"),
537-
configPreferences.get("board"),
513+
configPreferences.get("software"),
538514
Base.REVISION,
539515
includes,
540516
sourceName,
@@ -593,7 +569,7 @@ private String[] getCommandCompilerC(String avrBasePath,
593569
configPreferences.get("compiler.cpudef"),
594570
configPreferences.get("build.mcu"),
595571
configPreferences.get("build.f_cpu"),
596-
configPreferences.get("board"),
572+
configPreferences.get("software"),
597573
Base.REVISION,
598574
includes,
599575
sourceName,
@@ -652,7 +628,7 @@ static private String[] getCommandCompilerCPP(String avrBasePath,
652628
configPreferences.get("compiler.cpudef"),
653629
configPreferences.get("build.mcu"),
654630
configPreferences.get("build.f_cpu"),
655-
configPreferences.get("board"),
631+
configPreferences.get("software"),
656632
Base.REVISION,
657633
includes,
658634
sourceName,
@@ -727,6 +703,12 @@ static public ArrayList<File> findFilesInFolder(File folder, String extension,
727703
void compileSketch(String avrBasePath, String buildPath, ArrayList<String> includePaths, HashMap<String, String> configPreferences)
728704
throws RunnerException
729705
{
706+
System.out.println("compileSketch: start");
707+
System.out.println("includePaths: ");
708+
for (int i = 0; i < includePaths.size(); i++) {
709+
System.out.println("-I" + (String) includePaths.get(i));
710+
}
711+
730712
//logger.debug("compileSketch: start");
731713
this.objectFiles.addAll(compileFiles(avrBasePath, buildPath, includePaths,
732714
findFilesInPath(buildPath, "S", false),
@@ -741,14 +723,21 @@ void compileLibraries (String avrBasePath, String buildPath, ArrayList<String> i
741723
throws RunnerException
742724
{
743725
System.out.println("compileLibraries: start");
744-
726+
745727
for (File libraryFolder : sketch.getImportedLibraries()) {
746728
System.out.println("libraryFolder: " + libraryFolder);
747729
File outputFolder = new File(buildPath, libraryFolder.getName());
748730
File utilityFolder = new File(libraryFolder, "utility");
749731
createFolder(outputFolder);
750732
// this library can use includes in its utility/ folder
751733
includePaths.add(utilityFolder.getAbsolutePath());
734+
//debug includePaths
735+
System.out.println("includePaths: ");
736+
for (int i = 0; i < includePaths.size(); i++) {
737+
System.out.println("-I" + (String) includePaths.get(i));
738+
}
739+
740+
752741
objectFiles.addAll(
753742
compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths,
754743
findFilesInFolder(libraryFolder, "S", false),
@@ -778,6 +767,12 @@ void compileCore (String avrBasePath, String buildPath, String corePath, String
778767
ArrayList<String> includePaths = new ArrayList();
779768
includePaths.add(corePath); //include core path only
780769
if (pinsPath != null) includePaths.add(pinsPath);
770+
771+
//debug includePaths
772+
System.out.println("includePaths: ");
773+
for (int i = 0; i < includePaths.size(); i++) {
774+
System.out.println("-I" + (String) includePaths.get(i));
775+
}
781776

782777
String baseCommandString = configPreferences.get("recipe.ar.pattern");
783778
String commandString = "";

build/shared/lib/preferences.txt

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ run.present.exclusive.macosx = true
240240
board = uno
241241
target = arduino
242242
platform = avr
243+
software=ARDUINO
243244

244245
programmer = arduino:avrispmkii
245246

hardware/arduino/platforms.txt

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ avr.compiler.ldflags=
5858
avr.compiler.cpudef=-mmcu=
5959
avr.compiler.upload.cmd=
6060
avr.compiler.upload.flags=
61+
avr.compiler.define=-DARDUINO=
6162
avr.library.path=./hardware/arduino/cores/arduino
6263
avr.library.core.path=./libraries
6364

0 commit comments

Comments
 (0)