Shift simple programmer components from grammar to config.c table

This commit is contained in:
Stefan Rueger 2023-01-12 23:59:45 +00:00
parent 6b95f9d181
commit 0ae6c6543b
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
3 changed files with 11 additions and 66 deletions

View File

@ -63,9 +63,17 @@ extern char * yytext;
// Component description for config_gram.y, will be sorted appropriately on first use
Component_t avr_comp[] = {
// PROGRAMMER
pgm_comp_desc(desc, COMP_STRING),
pgm_comp_desc(prog_modes, COMP_INT),
pgm_comp_desc(baudrate, COMP_INT),
pgm_comp_desc(usbvid, COMP_INT),
pgm_comp_desc(usbdev, COMP_STRING),
pgm_comp_desc(usbsn, COMP_STRING),
pgm_comp_desc(usbvendor, COMP_STRING),
pgm_comp_desc(usbproduct, COMP_STRING),
// AVRPART
part_comp_desc(desc, COMP_STRING),
part_comp_desc(prog_modes, COMP_INT),
part_comp_desc(mcuid, COMP_INT),
part_comp_desc(n_interrupts, COMP_INT),

View File

@ -74,7 +74,6 @@ static int pin_name;
%token K_PAGED
%token K_ALIAS
%token K_BAUDRATE
%token K_BS2
%token K_BUFF
%token K_CHIP_ERASE_DELAY
@ -85,7 +84,6 @@ static int pin_name;
%token K_DEFAULT_PROGRAMMER
%token K_DEFAULT_SERIAL
%token K_DEFAULT_SPI
%token K_DESC
%token K_FAMILY_ID
%token K_HVUPDI_SUPPORT
%token K_HVUPDI_VARIANT
@ -129,12 +127,7 @@ static int pin_name;
%token K_SIGNATURE
%token K_SIZE
%token K_USB
%token K_USBDEV
%token K_USBSN
%token K_USBPID
%token K_USBPRODUCT
%token K_USBVENDOR
%token K_USBVID
%token K_TYPE
%token K_VCC
%token K_VFYLED
@ -481,20 +474,10 @@ prog_parm :
|
prog_parm_pins
|
prog_parm_usb
K_USBPID TKN_EQUAL usb_pid_list
|
prog_parm_conntype
|
K_DESC TKN_EQUAL TKN_STRING {
current_prog->desc = cache_string($3->value.string);
free_token($3);
} |
K_BAUDRATE TKN_EQUAL numexpr {
{
current_prog->baudrate = $3->value.number;
free_token($3);
}
} |
prog_parm_updi
;
@ -531,40 +514,6 @@ prog_parm_conntype_id:
K_SPI { current_prog->conntype = CONNTYPE_SPI; }
;
prog_parm_usb:
K_USBDEV TKN_EQUAL TKN_STRING {
{
current_prog->usbdev = cache_string($3->value.string);
free_token($3);
}
} |
K_USBVID TKN_EQUAL numexpr {
{
current_prog->usbvid = $3->value.number;
free_token($3);
}
} |
K_USBPID TKN_EQUAL usb_pid_list |
K_USBSN TKN_EQUAL TKN_STRING {
{
current_prog->usbsn = cache_string($3->value.string);
free_token($3);
}
} |
K_USBVENDOR TKN_EQUAL TKN_STRING {
{
current_prog->usbvendor = cache_string($3->value.string);
free_token($3);
}
} |
K_USBPRODUCT TKN_EQUAL TKN_STRING {
{
current_prog->usbproduct = cache_string($3->value.string);
free_token($3);
}
}
;
usb_pid_list:
numexpr {
{
@ -708,12 +657,6 @@ part_parm :
free_token($3);
} |
K_DESC TKN_EQUAL TKN_STRING
{
current_part->desc = cache_string($3->value.string);
free_token($3);
} |
K_FAMILY_ID TKN_EQUAL TKN_STRING
{
current_part->family_id = cache_string($3->value.string);

View File

@ -121,7 +121,8 @@ SIGN [+-]
}
(?x: prog_modes | mcuid | n_interrupts | n_page_erase | n_word_writes | n_boot_sections |
(?x: desc | prog_modes | baudrate | usbvid | usbdev | usbsn | usbvendor | usbproduct |
mcuid | n_interrupts | n_page_erase | n_word_writes | n_boot_sections |
boot_section_size | autobaud_sync | idr | rampz | spmcr | eecr | eind ) { /* struct components */
Component_t *cp = cfg_comp_search(yytext, current_strct);
@ -145,7 +146,6 @@ allowfullpagebitstream { yylval=NULL; ccap(); return K_ALLOWFULLPAGEBITSTREAM; }
avr910_devcode { yylval=NULL; ccap(); return K_AVR910_DEVCODE; }
bank_size { yylval=NULL; return K_PAGE_SIZE; }
banked { yylval=NULL; return K_PAGED; }
baudrate { yylval=NULL; ccap(); return K_BAUDRATE; }
blocksize { yylval=NULL; ccap(); return K_BLOCKSIZE; }
bs2 { yylval=NULL; ccap(); return K_BS2; }
buff { yylval=NULL; ccap(); return K_BUFF; }
@ -164,7 +164,6 @@ default_programmer { yylval=NULL; return K_DEFAULT_PROGRAMMER; }
default_serial { yylval=NULL; return K_DEFAULT_SERIAL; }
default_spi { yylval=NULL; return K_DEFAULT_SPI; }
delay { yylval=NULL; ccap(); return K_DELAY; }
desc { yylval=NULL; ccap(); return K_DESC; }
devicecode { yylval=NULL; ccap(); return K_DEVICECODE; }
eeprom { yylval=NULL; return K_EEPROM; }
eeprom_instr { yylval=NULL; ccap(); return K_EEPROM_INSTR; }
@ -258,12 +257,7 @@ timeout { yylval=NULL; ccap(); return K_TIMEOUT; }
togglevtg { yylval=NULL; ccap(); return K_TOGGLEVTG; }
type { yylval=NULL; ccap(); return K_TYPE; }
usb { yylval=NULL; return K_USB; }
usbdev { yylval=NULL; ccap(); return K_USBDEV; }
usbpid { yylval=NULL; ccap(); return K_USBPID; }
usbproduct { yylval=NULL; ccap(); return K_USBPRODUCT; }
usbsn { yylval=NULL; ccap(); return K_USBSN; }
usbvendor { yylval=NULL; ccap(); return K_USBVENDOR; }
usbvid { yylval=NULL; ccap(); return K_USBVID; }
vcc { yylval=NULL; ccap(); return K_VCC; }
vfyled { yylval=NULL; ccap(); return K_VFYLED; }
write { yylval=new_token(K_WRITE); ccap(); return K_WRITE; }