Skip to content

Commit 5fa8cd4

Browse files
Peter Van Hoyweghendamellis
authored andcommitted
Leonardo: after burning a sketch, remove the magic baud rate (1200bps) to avoid future unwanted board resets
1 parent f32ff00 commit 5fa8cd4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/src/processing/app/debug/AvrdudeUploader.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ private boolean uploadViaBootloader(String buildPath, String className)
185185
long timeout = System.currentTimeMillis() + 2000;
186186
while (timeout > System.currentTimeMillis()) {
187187
List<String> portList = Serial.list();
188-
if (portList.contains(Preferences.get("serial.port"))) {
188+
uploadPort = Preferences.get("serial.port");
189+
if (portList.contains(uploadPort)) {
190+
// Remove the magic baud rate (1200bps) to avoid future unwanted board resets
191+
int serialRate = Preferences.getInteger("serial.debug_rate");
192+
System.out.println("Set baud rate to " + serialRate);
193+
Serial.touchPort(uploadPort, serialRate);
189194
break;
190195
}
191196
try {

0 commit comments

Comments
 (0)