Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

‎arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java‎

Lines changed: 1 addition & 1 deletion
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) {

‎arduino-core/src/processing/app/Serial.java‎

Lines changed: 3 additions & 2 deletions
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, intirate) 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)

AltStyle によって変換されたページ (->オリジナル) /