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
This commit is contained in:
rliebscher 2013-11-30 12:11:32 +00:00
parent 897bf03884
commit bded1af4c7
3 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2013-11-30 Rene Liebscher <R.Liebscher@gmx.de>
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 <nils@nicai-systems.de>
* avrdude.conf.in (atmega1284): ATmega1284 variant added (same as ATmega1284p but with different signature)

View File

@ -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; i<N_PINS; i++) {
if ( pgm->pinno[i] != 0 ||
if ( (pgm->pinno[i] & PIN_MASK) != 0 ||
i == PIN_AVR_RESET ||
i == PIN_AVR_SCK ||
i == PIN_AVR_MOSI ||

View File

@ -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 */