Use HV UPDI constants rather than arbitrary numbers

This commit is contained in:
MCUdude 2022-06-26 19:54:40 +02:00
parent 50220289bb
commit 577856cf15
2 changed files with 8 additions and 3 deletions

View File

@ -1252,8 +1252,10 @@ static int jtag3_initialize(PROGRAMMER * pgm, AVRPART * p)
}
}
// Generate 12V UPDI pulse if user asks for it and hardware supports it
if(p->flags & AVRPART_HAS_UPDI && PDATA(pgm)->use_hvupdi == true && p->hvupdi_variant == 0) {
// Generate 12V UPDI pulse if user asks for it and hardware supports it
if (p->flags & AVRPART_HAS_UPDI &&
PDATA(pgm)->use_hvupdi == true &&
p->hvupdi_variant == HV_UPDI_VARIANT_0) {
parm[0] = PARM3_UPDI_HV_SIMPLE_PULSE;
if (jtag3_setparm(pgm, SCOPE_AVR, 3, PARM3_OPT_12V_UPDI_ENABLE, parm, 1) < 0)
return -1;
@ -1458,7 +1460,6 @@ static int jtag3_parseextparms(PROGRAMMER * pgm, LISTID extparms)
LNODEID ln;
const char *extended_param;
int rv = 0;
avrdude_message(MSG_INFO, "id: %s, desc: %s, type: %s\n", ldata(lfirst(pgm->id)), pgm->desc, pgm->type);
for (ln = lfirst(extparms); ln; ln = lnext(ln)) {
extended_param = ldata(ln);

View File

@ -188,6 +188,10 @@ typedef struct opcode {
#define AVRPART_IS_AT90S1200 0x1000 /* part is an AT90S1200 (needs special treatment) */
#define AVRPART_HAS_UPDI 0x2000 /* part has UPDI i/f (AVR8X) */
#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 AVR_DESCLEN 64
#define AVR_IDLEN 32
#define AVR_FAMILYIDLEN 7