Skip to content

Commit

Permalink
Leonardo: after burning a sketch, remove the magic baud rate (1200bps…
Browse files Browse the repository at this point in the history
…) to avoid future unwanted board resets
Peter Van Hoyweghen authored and damellis committed Sep 9, 2012
1 parent f32ff00 commit 5fa8cd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/processing/app/debug/AvrdudeUploader.java
Original file line number Diff line number Diff line change
@@ -185,7 +185,12 @@ private boolean uploadViaBootloader(String buildPath, String className)
long timeout = System.currentTimeMillis() + 2000;
while (timeout > System.currentTimeMillis()) {
List<String> portList = Serial.list();
if (portList.contains(Preferences.get("serial.port"))) {
uploadPort = Preferences.get("serial.port");
if (portList.contains(uploadPort)) {
// Remove the magic baud rate (1200bps) to avoid future unwanted board resets
int serialRate = Preferences.getInteger("serial.debug_rate");
System.out.println("Set baud rate to " + serialRate);
Serial.touchPort(uploadPort, serialRate);
break;
}
try {

0 comments on commit 5fa8cd4

Please sign in to comment.