Skip to content

Commit adeff81

Browse files
committed
Not forcing avrdude to continue on the wrong chip (removing -F command line argument), and improving (I hope) some of the error messages by trapping avrdude messages and displaying custom messages in the EditorStatus.
1 parent 0204d39 commit adeff81

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

app/AvrdudeUploader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public boolean uploadUsingPreferences(String buildPath, String className)
4242

4343
// avrdude doesn't want to read device signatures (it always gets
4444
// 0x000000); force it to continue uploading anyway
45-
commandDownloader.add("-F");
45+
//commandDownloader.add("-F");
4646

4747
String protocol = Preferences.get("boards." + Preferences.get("board") + ".upload.protocol");
4848

app/Uploader.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ else if(Base.isLinux()) {
145145
return false;
146146
} catch (Exception e) {
147147
String msg = e.getMessage();
148-
if ((msg != null) && (msg.indexOf("uisp: not found") != -1)) {
148+
if ((msg != null) && (msg.indexOf("uisp: not found") != -1) && (msg.indexOf("avrdude: not found") != -1)) {
149149
//System.err.println("uisp is missing");
150150
//JOptionPane.showMessageDialog(editor.base,
151151
// "Could not find the compiler.\n" +
@@ -199,16 +199,18 @@ public void message(String s) {
199199
exception = new RunnerException("the selected serial port "+s+" does not exist or your board is not connected");
200200
return;
201201
}
202-
// jikes always uses a forward slash character as its separator, so
203-
// we need to replace any platform-specific separator characters before
204-
// attemping to compare
205-
//
206202
if (s.indexOf("Device is not responding") != -1 ) {
207203
exception = new RunnerException("Device is not responding, check the right serial port is selected or RESET the board right before exporting");
208204
return;
209205
}
210-
if (s.indexOf("Programmer is not responding") != -1) {
211-
exception = new RunnerException("Programmer is not responding, RESET the board right before exporting");
206+
if (s.indexOf("Programmer is not responding") != -1 ||
207+
s.indexOf("programmer is not responding") != -1 ||
208+
s.indexOf("protocol error") != -1) {
209+
exception = new RunnerException("Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.");
210+
return;
211+
}
212+
if (s.indexOf("Expected signature") != -1) {
213+
exception = new RunnerException("Wrong microcontroller found. Did you select the right board from the Tools > Board menu?");
212214
return;
213215
}
214216
}

0 commit comments

Comments
 (0)