Skip to content

Commit

Permalink
fix case where elf might have cpp prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Me No Dev committed Feb 4, 2016
1 parent 287e0ce commit 2e23185
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/EspExceptionDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ private void createAndUpload(){
editor.statusError("Not Supported on "+PreferencesData.get("target_platform"));
return;
}

String tc = "esp108";
if(PreferencesData.get("target_platform").contentEquals("esp8266")){
tc = "lx106";
}

TargetPlatform platform = BaseNoGui.getTargetPlatform();

String gccPath = PreferencesData.get("runtime.tools.xtensa-"+tc+"-elf-gcc.path");
if(gccPath == null){
gccPath = platform.getFolder() + "/tools/xtensa-"+tc+"-elf";
}

String addr2line;
if(PreferencesData.get("runtime.os").contentEquals("windows"))
addr2line = "xtensa-"+tc+"-elf-addr2line.exe";
Expand All @@ -178,9 +178,12 @@ private void createAndUpload(){

elf = new File(getBuildFolderPath(editor.getSketch()), editor.getSketch().getName() + ".ino.elf");
if (!elf.exists() || !elf.isFile()) {
editor.statusError("ERROR: "+editor.getSketch().getName() + ".ino.elf not found!");
System.err.println("Did you forget to compile the sketch?");
return;
elf = new File(getBuildFolderPath(editor.getSketch()), editor.getSketch().getName() + ".cpp.elf");
if (!elf.exists() || !elf.isFile()){
editor.statusError("ERROR: neither "+editor.getSketch().getName() + ".ino.elf or "+editor.getSketch().getName() + ".cpp.elf were found!");
System.err.println("Did you forget to compile the sketch?");
return;
}
}

JFrame.setDefaultLookAndFeelDecorated(true);
Expand Down

0 comments on commit 2e23185

Please sign in to comment.