Add HVUPDI_SUPPORT list for programmers.

This commit is contained in:
Ruud, Jan Egil
2022-06-30 16:15:24 +02:00
committed by Jan Egil Ruud
parent 6473a6d71a
commit 9e5ea25b9e
5 changed files with 55 additions and 6 deletions

View File

@@ -81,6 +81,7 @@ static int pin_name;
%token K_DEFAULT_SERIAL
%token K_DESC
%token K_FAMILY_ID
%token K_HVUPDI_SUPPORT
%token K_HVUPDI_VARIANT
%token K_DEVICECODE
%token K_STK500_DEVCODE
@@ -547,6 +548,7 @@ prog_parm_usb:
free_token($3);
}
}
K_HVUPDI_SUPPORT TKN_EQUAL hvupdi_support_list
;
usb_pid_list:
@@ -577,6 +579,34 @@ usb_pid_list:
}
;
hvupdi_support_list:
TKN_NUMBER {
{
/* overwrite pids, so clear the existing entries */
ldestroy_cb(current_prog->hvupdi_support, free);
current_prog->hvupdi_support = lcreat(NULL, 0);
}
{
int *ip = malloc(sizeof(int));
if (ip) {
*ip = $1->value.number;
ladd(current_prog->hvupdi_support, ip);
}
free_token($1);
}
} |
hvupdi_support_list TKN_COMMA TKN_NUMBER {
{
int *ip = malloc(sizeof(int));
if (ip) {
*ip = $3->value.number;
ladd(current_prog->hvupdi_support, ip);
}
free_token($3);
}
}
;
pin_number_non_empty:
TKN_NUMBER { if(0 != assign_pin(pin_name, $1, 0)) YYABORT; }
|