Skip to content

Commit 2222e0f

Browse files
committed
Merge pull request #2709 from projectgus/master
Fix auto-reset on Leonardo-derived boards from Linux hosts
2 parents 72bf977 + a6909bd commit 2222e0f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
116116
if (verbose)
117117
System.out.println(
118118
I18n.format(_("Forcing reset using 1200bps open/close on port {0}"), uploadPort));
119-
Serial.touchPort(uploadPort, 1200);
119+
Serial.touchForCDCReset(uploadPort);
120120
}
121121
Thread.sleep(400);
122122
if (waitForUploadPort) {

Diff for: arduino-core/src/processing/app/Serial.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ public Serial(String iname) throws SerialException {
8080
new Float(PreferencesData.get("serial.stopbits")).floatValue());
8181
}
8282

83-
public static boolean touchPort(String iname, int irate) throws SerialException {
83+
public static boolean touchForCDCReset(String iname) throws SerialException {
8484
SerialPort serialPort = new SerialPort(iname);
8585
try {
8686
serialPort.openPort();
87-
serialPort.setParams(irate, 8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
87+
serialPort.setParams(1200, 8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
88+
serialPort.setDTR(false);
8889
serialPort.closePort();
8990
return true;
9091
} catch (SerialPortException e) {

0 commit comments

Comments
 (0)