mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Leonardo: after burning a sketch, remove the magic baud rate (1200bps) to avoid future unwanted board resets
This commit is contained in:
parent
f32ff0022e
commit
5fa8cd4130
@ -185,7 +185,12 @@ public class AvrdudeUploader extends Uploader {
|
|||||||
long timeout = System.currentTimeMillis() + 2000;
|
long timeout = System.currentTimeMillis() + 2000;
|
||||||
while (timeout > System.currentTimeMillis()) {
|
while (timeout > System.currentTimeMillis()) {
|
||||||
List<String> portList = Serial.list();
|
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;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user