1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03: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); port.setDTR(state);
} }
public void setRTS(boolean state) {
port.setRTS(state);
}
/** /**
* If this just hangs and never completes on Windows, * If this just hangs and never completes on Windows,
* it may be because the DLL doesn't have its exec bit set. * 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.setDTR(false);
serialPort.setRTS(false);
try { try {
Thread.sleep(100); Thread.sleep(100);
} catch (InterruptedException e) {} } catch (InterruptedException e) {}
serialPort.setDTR(true); serialPort.setDTR(true);
serialPort.setRTS(true);
serialPort.dispose(); serialPort.dispose();
} catch(Exception e) { } catch(Exception e) {