parent
b5699663c4
commit
577ee72db7
13
src/jtag3.c
13
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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue