mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-18 03:14:42 +00:00
Change definition of NO_PIN to 1+PIN_MAX (#1231)
Fixes bug #1228 that gpio 0 could not be used by the linuxgpio system. * Add sanity checks * Loop over defined pins only Co-authored-by: Stefan Rueger <stefan.rueger@urclocks.com>
This commit is contained in:
@@ -608,8 +608,13 @@ int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int verify_pin_assigned(const PROGRAMMER *pgm, int pin, char *desc) {
|
||||
if (pgm->pinno[pin] == 0) {
|
||||
static int verify_pin_assigned(const PROGRAMMER *pgm, int pinfunc, char *desc) {
|
||||
if(pinfunc < 0 || pinfunc >= N_PINS) {
|
||||
pmsg_error("invalid pin function number %d\n", pinfunc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pgm->pinno[pinfunc] & PIN_MASK) > PIN_MAX) {
|
||||
pmsg_error("no pin has been assigned for %s\n", desc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user