Index: avrpart.c =================================================================== --- avrpart.c (revision 1298) +++ avrpart.c (working copy) @@ -544,6 +544,27 @@ 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 Index: avrpart.h =================================================================== --- avrpart.h (revision 1298) +++ avrpart.h (working copy) @@ -222,6 +222,8 @@ void avr_free_part(AVRPART * d); AVRPART * locate_part(LISTID parts, char * partdesc); AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode); +AVRPART * locate_part_by_signature(LISTID parts, unsigned char * sig, + int sigsize); void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose); typedef void (*walk_avrparts_cb)(const char *name, const char *desc, Index: main.c =================================================================== --- main.c (revision 1298) +++ main.c (working copy) @@ -1063,6 +1063,14 @@ if (sig->buf[i] != 0x00) zz = 0; } + if (quell_progress < 2) { + AVRPART * part; + + part = locate_part_by_signature(part_list, sig->buf, sig->size); + if (part) { + fprintf(stderr, " (probably %s)", part->id); + } + } if (ff || zz) { if (++attempt < 3) { waittime *= 5;