When the specified part has a matching signature, print the specified part instead of one from the parts list

This commit is contained in:
Marius Greuel 2022-01-09 11:50:35 +01:00
parent e3338c428f
commit 1297098eae
1 changed files with 9 additions and 5 deletions

View File

@ -1218,12 +1218,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) {
@ -1252,10 +1259,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]);