Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HVUPDI_SUPPORT list for programmers. #2

Merged
merged 2 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/avrdude.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 7 additions & 3 deletions src/config_gram.y
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ prog_parm :
current_prog->baudrate = $3->value.number;
free_token($3);
}
}
} |
prog_parm_updi
;

prog_parm_type:
Expand Down Expand Up @@ -548,7 +549,6 @@ prog_parm_usb:
free_token($3);
}
}
K_HVUPDI_SUPPORT TKN_EQUAL hvupdi_support_list
;

usb_pid_list:
Expand Down Expand Up @@ -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);
}
Expand Down
9 changes: 9 additions & 0 deletions src/jtag3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
MCUdude marked this conversation as resolved.
Show resolved Hide resolved
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;

Expand Down
2 changes: 1 addition & 1 deletion src/libavrdude.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
MCUdude marked this conversation as resolved.
Show resolved Hide resolved
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 */
Expand Down
1 change: 1 addition & 0 deletions src/pgm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down