From 5fa8cd4130504b082372467ca9ff53172de88312 Mon Sep 17 00:00:00 2001 From: Peter Van Hoyweghen Date: Tue, 10 Jul 2012 22:10:11 +0200 Subject: [PATCH] Leonardo: after burning a sketch, remove the magic baud rate (1200bps) to avoid future unwanted board resets --- app/src/processing/app/debug/AvrdudeUploader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/debug/AvrdudeUploader.java b/app/src/processing/app/debug/AvrdudeUploader.java index b88f6a829..1948f9615 100755 --- a/app/src/processing/app/debug/AvrdudeUploader.java +++ b/app/src/processing/app/debug/AvrdudeUploader.java @@ -185,7 +185,12 @@ public class AvrdudeUploader extends Uploader { long timeout = System.currentTimeMillis() + 2000; while (timeout > System.currentTimeMillis()) { List 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 {