Move hvupdi_support list to a new prog_parm_updi group, and initialize the list.

This commit is contained in:
Jan Egil Ruud 2022-07-07 12:23:05 +02:00
parent 9e5ea25b9e
commit 91310e6f50
5 changed files with 19 additions and 5 deletions

View File

@ -40,7 +40,7 @@
# usbvendor = <vendorname>; # USB Vendor Name
# usbproduct = <productname>; # USB Product Name
# usbsn = <serialno>; # USB Serial Number
# hvupdi_support = <num>, <num>, ...; # UPDI HV Variants Support
# hvupdi_support = <num> [, <num>, ... ] ; # UPDI HV Variants Support
#
# To invert a bit, use = ~ <num>, the spaces are important.
# For a pin list all pins must be inverted.

View File

@ -477,7 +477,8 @@ prog_parm :
current_prog->baudrate = $3->value.number;
free_token($3);
}
}
} |
prog_parm_updi
;
prog_parm_type:
@ -548,7 +549,6 @@ prog_parm_usb:
free_token($3);
}
}
K_HVUPDI_SUPPORT TKN_EQUAL hvupdi_support_list
;
usb_pid_list:
@ -579,10 +579,14 @@ usb_pid_list:
}
;
prog_parm_updi:
K_HVUPDI_SUPPORT TKN_EQUAL hvupdi_support_list
;
hvupdi_support_list:
TKN_NUMBER {
{
/* overwrite pids, so clear the existing entries */
/* overwrite list entries, so clear the existing entries */
ldestroy_cb(current_prog->hvupdi_support, free);
current_prog->hvupdi_support = lcreat(NULL, 0);
}

View File

@ -1649,6 +1649,15 @@ static int jtag3_open_updi(PROGRAMMER * pgm, char * port)
{
avrdude_message(MSG_NOTICE2, "%s: jtag3_open_updi()\n", progname);
LNODEID ln;
unsigned int hv_sup;
avrdude_message(MSG_NOTICE2, "%s: HV UPDI support:", progname);
for (ln = lfirst(pgm->hvupdi_support); ln; ln = lnext(ln)) {
hv_sup = (unsigned int)(*(int *)ldata(ln));
avrdude_message(MSG_NOTICE2, " %d", hv_sup);
}
avrdude_message(MSG_NOTICE2, "\n", progname);
if (jtag3_open_common(pgm, port) < 0)
return -1;

View File

@ -206,7 +206,7 @@ typedef struct avrpart {
char desc[AVR_DESCLEN]; /* long part name */
char id[AVR_IDLEN]; /* short part name */
char family_id[AVR_FAMILYIDLEN+1]; /* family id in the SIB (avr8x) */
int hvupdi_variant; /* 12V pulse on UPDI pin, no pin or RESET pin */
int hvupdi_variant; /* HV pulse on UPDI pin, no pin or RESET pin */
int stk500_devcode; /* stk500 device code */
int avr910_devcode; /* avr910 device code */
int chip_erase_delay; /* microseconds */

View File

@ -83,6 +83,7 @@ PROGRAMMER * pgm_new(void)
pgm->lineno = 0;
pgm->baudrate = 0;
pgm->initpgm = NULL;
pgm->hvupdi_support = lcreat(NULL, 0);
for (i=0; i<N_PINS; i++) {
pgm->pinno[i] = 0;