From 3b793351bb6a13c43137cf7f7612ac562c6b8a54 Mon Sep 17 00:00:00 2001 From: Rene Liebscher Date: Sat, 30 Nov 2013 12:11:32 +0000 Subject: [PATCH] bug #40748 linuxgpio doesn't work on Raspberry PI rev. 2. * linuxgpio.c: fixed check for unused pins to ignore the inverse flag * pindefs.c: fixed fill_old_pinlist to not create an empty mask with inverse flag set git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1251 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 6 ++++++ linuxgpio.c | 2 +- pindefs.c | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49b8d351..6bec728e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-11-30 Rene Liebscher + + bug #40748 linuxgpio doesn't work on Raspberry PI rev. 2. + * linuxgpio.c: fixed check for unused pins to ignore the inverse flag + * pindefs.c: fixed fill_old_pinlist to not create an empty mask with inverse flag set + 2013-10-18 Nils Springob * avrdude.conf.in (atmega1284): ATmega1284 variant added (same as ATmega1284p but with different signature) diff --git a/linuxgpio.c b/linuxgpio.c index e6452e2c..9fb6af91 100644 --- a/linuxgpio.c +++ b/linuxgpio.c @@ -258,7 +258,7 @@ static int linuxgpio_open(PROGRAMMER *pgm, char *port) //mostry LED status, can't be set to GPIO0. It can be fixed when a better //solution exists. for (i=0; ipinno[i] != 0 || + if ( (pgm->pinno[i] & PIN_MASK) != 0 || i == PIN_AVR_RESET || i == PIN_AVR_SCK || i == PIN_AVR_MOSI || diff --git a/pindefs.c b/pindefs.c index 8842649c..71f0898d 100644 --- a/pindefs.c +++ b/pindefs.c @@ -90,7 +90,10 @@ static void pin_fill_old_pinlist(const struct pindef_t * const pindef, unsigned fprintf(stderr, "Pins of higher index than max field size for old pinno found\n"); exit(1); } - if(pindef->mask[i] == pindef->inverse[i]) { /* all set bits in mask are set in inverse */ + if (pindef->mask[i] == 0) { + /* this pin function is not using any pins */ + *pinno = 0; + } else if(pindef->mask[i] == pindef->inverse[i]) { /* all set bits in mask are set in inverse */ *pinno = pindef->mask[i]; *pinno |= PIN_INVERSE; } else if(pindef->mask[i] == ((~pindef->inverse[i]) & pindef->mask[i])) { /* all set bits in mask are cleared in inverse */