mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-15 02:01:07 +00:00
patch #8440 Print part id after signature
When printing the part signature also print the part id. * avrpart.c (locate_part_by_signature): New function. * libavrdude.h (locate_part_by_signature): New function. * main.c (main): Use the new function to find the part and print its id. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1332 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
21
avrpart.c
21
avrpart.c
@@ -540,6 +540,27 @@ AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AVRPART * locate_part_by_signature(LISTID parts, unsigned char * sig,
|
||||
int sigsize)
|
||||
{
|
||||
LNODEID ln1;
|
||||
AVRPART * p = NULL;
|
||||
int i;
|
||||
|
||||
if (sigsize == 3) {
|
||||
for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) {
|
||||
p = ldata(ln1);
|
||||
for (i=0; i<3; i++)
|
||||
if (p->signature[i] != sig[i])
|
||||
break;
|
||||
if (i == 3)
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Iterate over the list of avrparts given as "avrparts", and
|
||||
* call the callback function cb for each entry found. cb is being
|
||||
|
||||
Reference in New Issue
Block a user