Skip to content

Fix auto-reset on Leonardo-derived boards from Linux hosts #2709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
if (verbose)
System.out.println(
I18n.format(_("Forcing reset using 1200bps open/close on port {0}"), uploadPort));
Serial.touchPort(uploadPort, 1200);
Serial.touchForCDCReset(uploadPort);
}
Thread.sleep(400);
if (waitForUploadPort) {
Expand Down
5 changes: 3 additions & 2 deletions arduino-core/src/processing/app/Serial.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ public Serial(String iname) throws SerialException {
new Float(PreferencesData.get("serial.stopbits")).floatValue());
}

public static boolean touchPort(String iname, int irate) throws SerialException {
public static boolean touchForCDCReset(String iname) throws SerialException {
SerialPort serialPort = new SerialPort(iname);
try {
serialPort.openPort();
serialPort.setParams(irate, 8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
serialPort.setParams(1200, 8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
serialPort.setDTR(false);
serialPort.closePort();
return true;
} catch (SerialPortException e) {
Expand Down