From 084b860e60448de72aeb38d70aa2d0c21f7e45f2 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Thu, 19 Jul 2007 00:26:08 +0000 Subject: [PATCH] toggling DTR explicitly before upload (and adding setDTR to serial.java) --- app/Serial.java | 3 +++ app/Uploader.java | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/app/Serial.java b/app/Serial.java index 802f9511b..2d80271be 100755 --- a/app/Serial.java +++ b/app/Serial.java @@ -476,6 +476,9 @@ public class Serial implements SerialPortEventListener { write(what.getBytes()); } + public void setDTR(boolean state) { + port.setDTR(state); + } /** * If this just hangs and never completes on Windows, diff --git a/app/Uploader.java b/app/Uploader.java index de47c102a..335da5261 100755 --- a/app/Uploader.java +++ b/app/Uploader.java @@ -72,6 +72,15 @@ public abstract class Uploader implements MessageConsumer { Thread.sleep(100); } catch (InterruptedException e) {} } + + serialPort.setDTR(false); + + try { + Thread.sleep(100); + } catch (InterruptedException e) {} + + serialPort.setDTR(true); + serialPort.dispose(); }