Add avrdude.conf syntax opcode = NULL; for SPI programming

This commit is contained in:
Stefan Rueger 2022-07-19 15:38:54 +01:00
parent f8b6a246ef
commit 8503f2d2d5
2 changed files with 29 additions and 0 deletions

View File

@ -50,6 +50,8 @@ static int parse_cmdbits(OPCODE * op, int opnum);
static int pin_name; static int pin_name;
%} %}
%token K_NULL;
%token K_READ %token K_READ
%token K_WRITE %token K_WRITE
%token K_READ_LO %token K_READ_LO
@ -1326,6 +1328,19 @@ part_parm :
} }
current_part->op[opnum] = op; current_part->op[opnum] = op;
free_token($1);
}
} |
opcode TKN_EQUAL K_NULL {
{
int opnum = which_opcode($1);
if(opnum < 0)
YYABORT;
if(current_part->op[opnum] != NULL)
avr_free_opcode(current_part->op[opnum]);
current_part->op[opnum] = NULL;
free_token($1); free_token($1);
} }
} }
@ -1473,6 +1488,19 @@ mem_spec :
} }
current_mem->op[opnum] = op; current_mem->op[opnum] = op;
free_token($1);
}
} |
opcode TKN_EQUAL K_NULL {
{
int opnum = which_opcode($1);
if(opnum < 0)
YYABORT;
if(current_mem->op[opnum] != NULL)
avr_free_opcode(current_mem->op[opnum]);
current_mem->op[opnum] = NULL;
free_token($1); free_token($1);
} }
} }

View File

@ -176,6 +176,7 @@ miso { yylval=NULL; return K_MISO; }
mode { yylval=NULL; return K_MODE; } mode { yylval=NULL; return K_MODE; }
mosi { yylval=NULL; return K_MOSI; } mosi { yylval=NULL; return K_MOSI; }
no { yylval=new_token(K_NO); return K_NO; } no { yylval=new_token(K_NO); return K_NO; }
NULL { yylval=NULL; return K_NULL; }
num_banks { yylval=NULL; return K_NUM_PAGES; } num_banks { yylval=NULL; return K_NUM_PAGES; }
num_pages { yylval=NULL; return K_NUM_PAGES; } num_pages { yylval=NULL; return K_NUM_PAGES; }
nvm_base { yylval=NULL; return K_NVM_BASE; } nvm_base { yylval=NULL; return K_NVM_BASE; }