Leonardo: after burning a sketch, remove the magic baud rate (1200bps) to avoid future unwanted board resets

This commit is contained in:
Peter Van Hoyweghen 2012-07-10 22:10:11 +02:00 committed by David A. Mellis
parent f32ff0022e
commit 5fa8cd4130
1 changed files with 6 additions and 1 deletions

View File

@ -185,7 +185,12 @@ public class AvrdudeUploader extends Uploader {
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 {