diff --git a/src/jtag3.c b/src/jtag3.c index c5a48bf6..146bed4b 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -1198,22 +1198,21 @@ static int jtag3_initialize(const PROGRAMMER *pgm, const AVRPART *p) { } // Generate UPDI high-voltage pulse if user asks for it and hardware supports it - LNODEID support; if (p->prog_modes & PM_UPDI && PDATA(pgm)->use_hvupdi == true && p->hvupdi_variant != HV_UPDI_VARIANT_1) { parm[0] = PARM3_UPDI_HV_NONE; - for (support = lfirst(pgm->hvupdi_support); support != NULL; support = lnext(support)) { - if(*(int *) ldata(support) == p->hvupdi_variant) { + for (LNODEID ln = lfirst(pgm->hvupdi_support); ln; ln = lnext(ln)) { + if(*(int *) ldata(ln) == p->hvupdi_variant) { pmsg_notice("sending HV pulse to targets %s pin\n", p->hvupdi_variant == HV_UPDI_VARIANT_0? "UPDI": "RESET"); parm[0] = PARM3_UPDI_HV_SIMPLE_PULSE; break; } - if (parm[0] == PARM3_UPDI_HV_NONE) { - pmsg_error("%s does not support sending HV pulse to target %s\n", pgm->desc, p->desc); - return -1; - } + } + if (parm[0] == PARM3_UPDI_HV_NONE) { + pmsg_error("%s does not support sending HV pulse to target %s\n", pgm->desc, p->desc); + return -1; } if (jtag3_setparm(pgm, SCOPE_AVR, 3, PARM3_OPT_12V_UPDI_ENABLE, parm, 1) < 0) return -1; diff --git a/src/libavrdude.h b/src/libavrdude.h index a804cc6b..38bc1f42 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -209,7 +209,7 @@ typedef struct opcode { #define HV_UPDI_VARIANT_0 0 /* Shared UPDI/GPIO/RESET pin, HV on UPDI pin (tinyAVR0/1/2)*/ #define HV_UPDI_VARIANT_1 1 /* Dedicated UPDI pin, no HV (megaAVR0/AVR-Dx) */ -#define HV_UPDI_VARIANT_2 2 /* Shared UPDI pin, HV on _RESET (AVR-Ex) */ +#define HV_UPDI_VARIANT_2 2 /* Shared UPDI pin, HV on _RESET (AVR-DD/AVR-Ex) */ #define AVR_FAMILYIDLEN 7 #define AVR_SIBLEN 16