mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Leonardo: after burning a sketch, remove the magic baud rate (1200bps) to avoid future unwanted board resets
This commit is contained in:
committed by
David A. Mellis
parent
f32ff0022e
commit
5fa8cd4130
@ -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 {
|
||||
|
Reference in New Issue
Block a user