From 4b515d005c1bff6c0efb3c1aa5632a37ee3c3318 Mon Sep 17 00:00:00 2001 From: joerg_wunsch Date: Fri, 8 Jan 2010 16:31:54 +0000 Subject: [PATCH] bug #27505: serbb_posix does not cope with inverted pins * serbb_posix (serbb_highpulsepin): apply PIN_MASK when checking pin numbers. * serbb_win32 (serbb_highpulsepin): (Dito.) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@896 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 7 +++++++ serbb_posix.c | 2 +- serbb_win32.c | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70b231df..9b2a44e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-01-08 Joerg Wunsch + + bug #27505: serbb_posix does not cope with inverted pins + * serbb_posix (serbb_highpulsepin): apply PIN_MASK when + checking pin numbers. + * serbb_win32 (serbb_highpulsepin): (Dito.) + 2010-01-08 Joerg Wunsch bug #28516: Linux/Dragon: Error message on exit diff --git a/serbb_posix.c b/serbb_posix.c index 8ea58db5..25b2e2bd 100644 --- a/serbb_posix.c +++ b/serbb_posix.c @@ -174,7 +174,7 @@ static int serbb_getpin(PROGRAMMER * pgm, int pin) static int serbb_highpulsepin(PROGRAMMER * pgm, int pin) { - if ( pin < 1 || pin > DB9PINS ) + if ( (pin & PIN_MASK) < 1 || (pin & PIN_MASK) > DB9PINS ) return -1; serbb_setpin(pgm, pin, 1); diff --git a/serbb_win32.c b/serbb_win32.c index 8c755210..bbf27b76 100644 --- a/serbb_win32.c +++ b/serbb_win32.c @@ -223,8 +223,8 @@ static int serbb_getpin(PROGRAMMER * pgm, int pin) static int serbb_highpulsepin(PROGRAMMER * pgm, int pin) { - if (pin < 1 || pin > 7) - return -1; + if ( (pin & PIN_MASK) < 1 || (pin & PIN_MASK) > DB9PINS ) + return -1; serbb_setpin(pgm, pin, 1); if (pgm->ispdelay > 1)