Add avrdude.conf syntax ((pp|hvsp)_controlstack|(eeprom|flash)_instr) = NULL;

This commit is contained in:
Stefan Rueger 2022-07-19 16:16:55 +01:00
parent 1555906604
commit bdb5ba6055
2 changed files with 28 additions and 2 deletions

View File

@ -800,6 +800,13 @@ part_parm :
} }
} | } |
K_PP_CONTROLSTACK TKN_EQUAL K_NULL {
{
current_part->ctl_stack_type = CTL_STACK_NONE;
memset(current_part->controlstack, 0, CTL_STACK_SIZE);
}
} |
K_HVSP_CONTROLSTACK TKN_EQUAL num_list { K_HVSP_CONTROLSTACK TKN_EQUAL num_list {
{ {
TOKEN * t; TOKEN * t;
@ -831,6 +838,13 @@ part_parm :
} }
} | } |
K_HVSP_CONTROLSTACK TKN_EQUAL K_NULL {
{
current_part->ctl_stack_type = CTL_STACK_NONE;
memset(current_part->controlstack, 0, CTL_STACK_SIZE);
}
} |
K_FLASH_INSTR TKN_EQUAL num_list { K_FLASH_INSTR TKN_EQUAL num_list {
{ {
TOKEN * t; TOKEN * t;
@ -861,6 +875,12 @@ part_parm :
} }
} | } |
K_FLASH_INSTR TKN_EQUAL K_NULL {
{
memset(current_part->flash_instr, 0, FLASH_INSTR_SIZE);
}
} |
K_EEPROM_INSTR TKN_EQUAL num_list { K_EEPROM_INSTR TKN_EQUAL num_list {
{ {
TOKEN * t; TOKEN * t;
@ -891,6 +911,12 @@ part_parm :
} }
} | } |
K_EEPROM_INSTR TKN_EQUAL K_NULL {
{
memset(current_part->eeprom_instr, 0, EEPROM_INSTR_SIZE);
}
} |
K_CHIP_ERASE_DELAY TKN_EQUAL TKN_NUMBER K_CHIP_ERASE_DELAY TKN_EQUAL TKN_NUMBER
{ {
current_part->chip_erase_delay = $3->value.number; current_part->chip_erase_delay = $3->value.number;

View File

@ -363,13 +363,13 @@ static const char *dev_controlstack_name(AVRPART *p) {
return return
p->ctl_stack_type == CTL_STACK_PP? "pp_controlstack": p->ctl_stack_type == CTL_STACK_PP? "pp_controlstack":
p->ctl_stack_type == CTL_STACK_HVSP? "hvsp_controlstack": p->ctl_stack_type == CTL_STACK_HVSP? "hvsp_controlstack":
p->ctl_stack_type == CTL_STACK_NONE? "NONE": p->ctl_stack_type == CTL_STACK_NONE? "NULL":
"unknown_controlstack"; "unknown_controlstack";
} }
static void dev_stack_out(bool tsv, AVRPART *p, const char *name, unsigned char *stack, int ns) { static void dev_stack_out(bool tsv, AVRPART *p, const char *name, unsigned char *stack, int ns) {
if(!strcmp(name, "NONE")) { if(!strcmp(name, "NULL")) {
name = "pp_controlstack"; name = "pp_controlstack";
ns = 0; ns = 0;
} }