Improve error detection logic

This commit is contained in:
MCUdude 2022-07-29 12:48:53 +02:00
parent 104dcf6052
commit de124bfd9b
1 changed files with 1 additions and 1 deletions

View File

@ -1306,7 +1306,7 @@ static int jtagmkII_initialize(PROGRAMMER * pgm, AVRPART * p)
const char *ifname; const char *ifname;
/* Abort and print error if programmer does not support the target microcontroller */ /* Abort and print error if programmer does not support the target microcontroller */
if ((strncmp(pgm->type, "JTAGMKII_UPDI", strlen("JTAGMKII_UPDI")) == 0 && p->flags & AVRPART_HAS_PDI) || if ((strncmp(pgm->type, "JTAGMKII_UPDI", strlen("JTAGMKII_UPDI")) == 0 && !(p->flags & AVRPART_HAS_UPDI)) ||
(strncmp(ldata(lfirst(pgm->id)), "jtagmkII", strlen("jtagmkII")) == 0 && p->flags & AVRPART_HAS_UPDI)) { (strncmp(ldata(lfirst(pgm->id)), "jtagmkII", strlen("jtagmkII")) == 0 && p->flags & AVRPART_HAS_UPDI)) {
avrdude_message(MSG_INFO, "ERROR: programmer %s does not support target %s\n\n", avrdude_message(MSG_INFO, "ERROR: programmer %s does not support target %s\n\n",
ldata(lfirst(pgm->id)), p->desc); ldata(lfirst(pgm->id)), p->desc);