mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-01 23:29:28 +01:00
toggling DTR explicitly before upload (and adding setDTR to serial.java)
This commit is contained in:
parent
b9569c389e
commit
084b860e60
@ -476,6 +476,9 @@ public class Serial implements SerialPortEventListener {
|
|||||||
write(what.getBytes());
|
write(what.getBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDTR(boolean state) {
|
||||||
|
port.setDTR(state);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this just hangs and never completes on Windows,
|
* If this just hangs and never completes on Windows,
|
||||||
|
@ -72,6 +72,15 @@ public abstract class Uploader implements MessageConsumer {
|
|||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
serialPort.setDTR(false);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(100);
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
|
||||||
|
serialPort.setDTR(true);
|
||||||
|
|
||||||
serialPort.dispose();
|
serialPort.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user