mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Tweaks to post-upload touch for Leonardo upload.
Added a delay to avoid exceptions when touching the serial port. Only printing the debug message in verbose mode.
This commit is contained in:
parent
5fa8cd4130
commit
e2b99206d8
@ -187,9 +187,13 @@ public class AvrdudeUploader extends Uploader {
|
||||
List<String> portList = Serial.list();
|
||||
uploadPort = Preferences.get("serial.port");
|
||||
if (portList.contains(uploadPort)) {
|
||||
try {
|
||||
Thread.sleep(100); // delay to avoid port in use and invalid parameters errors
|
||||
} catch (InterruptedException ex) { }
|
||||
// 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);
|
||||
if (verbose || Preferences.getBoolean("upload.verbose"))
|
||||
System.out.println("Setting baud rate to " + serialRate + " on " + uploadPort);
|
||||
Serial.touchPort(uploadPort, serialRate);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user