From 7af6da70fbc17647d58d5c7619080af14cac27f6 Mon Sep 17 00:00:00 2001 From: Michal Ludvig Date: Sun, 7 Mar 2010 21:27:22 +0000 Subject: [PATCH] * 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@940 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 5 +++++ avrdude/ser_posix.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 907be896..1b8650dd 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,8 @@ +2010-03-08 Michal Ludvig + + * ser_posix.c(ser_set_dtr_rts): Fixed DTR on/off to make + Arduino auto-reset work. (bug #29108, patch #7100) + 2010-03-05 Joerg Wunsch * buspirate.c: Replace printf() by fprintf(stderr) diff --git a/avrdude/ser_posix.c b/avrdude/ser_posix.c index a37e5290..5344115b 100644 --- a/avrdude/ser_posix.c +++ b/avrdude/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) {