mirror of https://github.com/noisymime/Arduino.git
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…
Reference in New Issue