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:
parent
9a810880da
commit
c5e8c3e4bd
@ -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.
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user