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:
@ -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.
|
||||||
|
@ -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) {
|
||||||
|
Reference in New Issue
Block a user