1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

Toggling RTS as well as DTR for auto-reset.

This commit is contained in:
David A. Mellis 2010-08-10 01:32:28 +00:00
parent 9a810880da
commit c5e8c3e4bd
2 changed files with 6 additions and 0 deletions

View File

@ -496,6 +496,10 @@ public class Serial implements SerialPortEventListener {
port.setDTR(state);
}
public void setRTS(boolean state) {
port.setRTS(state);
}
/**
* If this just hangs and never completes on Windows,
* it may be because the DLL doesn't have its exec bit set.

View File

@ -80,12 +80,14 @@ public abstract class Uploader implements MessageConsumer {
}
serialPort.setDTR(false);
serialPort.setRTS(false);
try {
Thread.sleep(100);
} catch (InterruptedException e) {}
serialPort.setDTR(true);
serialPort.setRTS(true);
serialPort.dispose();
} catch(Exception e) {