diff --git a/src/config_gram.y b/src/config_gram.y index d82fae9e..e2a935cf 100644 --- a/src/config_gram.y +++ b/src/config_gram.y @@ -294,7 +294,7 @@ prog_def : lrmv_d(programmers, existing_prog); pgm_free(existing_prog); } - PUSH(programmers, current_prog); + LISTADD(programmers, current_prog); // pgm_fill_old_pins(current_prog); // TODO to be removed if old pin data no longer needed // pgm_display_generic(current_prog, id); current_prog = NULL; @@ -387,7 +387,7 @@ part_def : lrmv_d(part_list, existing_part); avr_free_part(existing_part); } - PUSH(part_list, current_part); + LISTADD(part_list, current_part); current_part = NULL; } ; diff --git a/src/main.c b/src/main.c index 8bc051a9..1cf87d61 100644 --- a/src/main.c +++ b/src/main.c @@ -1221,12 +1221,19 @@ int main(int argc, char * argv []) if (sig->buf[i] != 0x00) zz = 0; } + + bool signature_matches = + sig->size == 3 && + sig->buf[0] == p->signature[0] && + sig->buf[1] == p->signature[1] && + sig->buf[2] == p->signature[2]; + if (quell_progress < 2) { AVRPART * part; part = locate_part_by_signature(part_list, sig->buf, sig->size); if (part) { - avrdude_message(MSG_INFO, " (probably %s)", part->id); + avrdude_message(MSG_INFO, " (probably %s)", signature_matches ? p->id : part->id); } } if (ff || zz) { @@ -1255,10 +1262,7 @@ int main(int argc, char * argv []) } } - if (sig->size != 3 || - sig->buf[0] != p->signature[0] || - sig->buf[1] != p->signature[1] || - sig->buf[2] != p->signature[2]) { + if (!signature_matches) { avrdude_message(MSG_INFO, "%s: Expected signature for %s is %02X %02X %02X\n", progname, p->desc, p->signature[0], p->signature[1], p->signature[2]);