commit d699f2bbd545df487885c994e2060d697dd023dc
Author: mludvig <mludvig@81a1dc3b-b13d-400b-aceb-764788c761c2>
Date: Sun Mar 7 21:27:22 2010 +0000
* ser_posix.c(ser_set_dtr_rts): Fixed DTR on/off to make
Arduino auto-reset work. (bug #29108, patch #7100)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@940 81a1dc3b-b13d-400b-aceb-764788c761c2
diff --git a/ser_posix.c b/ser_posix.c
index a37e529..5344115 100644
--- a/ser_posix.c
+++ b/ser_posix.c
@@ -230,13 +230,13 @@ static int ser_set_dtr_rts(union filedescriptor *fdp, int is_on)
}
if (is_on) {
- /* Clear DTR and RTS */
- ctl &= ~(TIOCM_DTR | TIOCM_RTS);
- }
- else {
/* Set DTR and RTS */
ctl |= (TIOCM_DTR | TIOCM_RTS);
}
+ else {
+ /* Clear DTR and RTS */
+ ctl &= ~(TIOCM_DTR | TIOCM_RTS);
+ }
r = ioctl(fdp->ifd, TIOCMSET, &ctl);
if (r < 0) {