From cd5a2a9a47ff21d6ca4eb19c54695cb17bc97466 Mon Sep 17 00:00:00 2001 From: joerg_wunsch Date: Fri, 15 Jan 2010 16:40:17 +0000 Subject: [PATCH] Submitted by Soren Jorvang: bug #28611: -i delay not being applied to all serial port bit banging state transitions * serbb_win32.c: Apply ispdelay everywhere. * serbb_posix.c: (Dito.) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@917 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 8 ++++++++ serbb_posix.c | 14 +++++++------- serbb_win32.c | 9 ++++----- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 830f4aa6..2bfa1aa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-01-15 Joerg Wunsch + + Submitted by Soren Jorvang: + bug #28611: -i delay not being applied to all serial port + bit banging state transitions + * serbb_win32.c: Apply ispdelay everywhere. + * serbb_posix.c: (Dito.) + 2010-01-15 Joerg Wunsch * stk500v2_private.h: Implement TPI mode for AVRISPmkII/STK600 diff --git a/serbb_posix.c b/serbb_posix.c index 25b2e2bd..5f886c42 100644 --- a/serbb_posix.c +++ b/serbb_posix.c @@ -97,7 +97,7 @@ static int serbb_setpin(PROGRAMMER * pgm, int pin, int value) perror("ioctl(\"TIOCxBRK\")"); return -1; } - return 0; + break; case 4: /* dtr */ case 7: /* rts */ @@ -115,11 +115,16 @@ static int serbb_setpin(PROGRAMMER * pgm, int pin, int value) perror("ioctl(\"TIOCMSET\")"); return -1; } - return 0; + break; default: /* impossible */ return -1; } + + if (pgm->ispdelay > 1) + bitbang_delay(pgm->ispdelay); + + return 0; } static int serbb_getpin(PROGRAMMER * pgm, int pin) @@ -178,12 +183,7 @@ static int serbb_highpulsepin(PROGRAMMER * pgm, int pin) return -1; serbb_setpin(pgm, pin, 1); - if (pgm->ispdelay > 1) - bitbang_delay(pgm->ispdelay); - serbb_setpin(pgm, pin, 0); - if (pgm->ispdelay > 1) - bitbang_delay(pgm->ispdelay); return 0; } diff --git a/serbb_win32.c b/serbb_win32.c index bbf27b76..62c70405 100644 --- a/serbb_win32.c +++ b/serbb_win32.c @@ -125,6 +125,10 @@ static int serbb_setpin(PROGRAMMER * pgm, int pin, int value) LocalFree(lpMsgBuf); exit(1); } + + if (pgm->ispdelay > 1) + bitbang_delay(pgm->ispdelay); + return 0; } @@ -227,12 +231,7 @@ static int serbb_highpulsepin(PROGRAMMER * pgm, int pin) return -1; serbb_setpin(pgm, pin, 1); - if (pgm->ispdelay > 1) - bitbang_delay(pgm->ispdelay); - serbb_setpin(pgm, pin, 0); - if (pgm->ispdelay > 1) - bitbang_delay(pgm->ispdelay); return 0; }