From de124bfd9b3b4a002b71bf73574d412c0c9bb573 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Fri, 29 Jul 2022 12:48:53 +0200 Subject: [PATCH] Improve error detection logic --- src/jtagmkII.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jtagmkII.c b/src/jtagmkII.c index 675c9540..7181d186 100644 --- a/src/jtagmkII.c +++ b/src/jtagmkII.c @@ -1306,7 +1306,7 @@ static int jtagmkII_initialize(PROGRAMMER * pgm, AVRPART * p) const char *ifname; /* 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)) { avrdude_message(MSG_INFO, "ERROR: programmer %s does not support target %s\n\n", ldata(lfirst(pgm->id)), p->desc);