Extend rather than reset memory entries in avrdude.conf
This commit changes the philosophy whenever avrdude.conf encounters the same memory of a part for the second time or whenever a memory is described that, through inheritance, already existed: AVRDUDE no longer zaps the memory, it rather extends it. Therefore, avrdude.conf.in's entry for ATmega128RFA1, which inherits from the ATmega2561, needs a line `load_ext_addr = NULL;` in its flash memory description to zap the inherited load_ext_addr SPI command. Other than this, avrdude.conf.in needs no other change in order to effect the same internal representation proving earlier updates to the .conf.in file correct that manually ensured inheritance of memory contents.
This commit is contained in:
parent
bdb5ba6055
commit
db37c9d286
|
@ -11845,6 +11845,8 @@ part parent "m2561"
|
|||
" a7 x x x x x x x",
|
||||
" x x x x x x x x";
|
||||
|
||||
load_ext_addr = NULL;
|
||||
|
||||
mode = 0x41;
|
||||
delay = 20;
|
||||
blocksize = 256;
|
||||
|
|
|
@ -1304,31 +1304,27 @@ part_parm :
|
|||
*/
|
||||
|
||||
K_MEMORY TKN_STRING
|
||||
{
|
||||
current_mem = avr_new_memtype();
|
||||
if (current_mem == NULL) {
|
||||
yyerror("could not create mem instance");
|
||||
free_token($2);
|
||||
YYABORT;
|
||||
{ /* select memory for extension or create if not there */
|
||||
AVRMEM *mem = avr_locate_mem_noalias(current_part, $2->value.string);
|
||||
if(!mem) {
|
||||
if(!(mem = avr_new_memtype())) {
|
||||
yyerror("could not create mem instance");
|
||||
free_token($2);
|
||||
YYABORT;
|
||||
}
|
||||
strncpy(mem->desc, $2->value.string, AVR_MEMDESCLEN - 1);
|
||||
mem->desc[AVR_MEMDESCLEN-1] = 0;
|
||||
ladd(current_part->mem, mem);
|
||||
}
|
||||
strncpy(current_mem->desc, $2->value.string, AVR_MEMDESCLEN - 1);
|
||||
current_mem->desc[AVR_MEMDESCLEN-1] = 0;
|
||||
current_mem = mem;
|
||||
free_token($2);
|
||||
}
|
||||
mem_specs
|
||||
{
|
||||
AVRMEM * existing_mem;
|
||||
|
||||
existing_mem = avr_locate_mem_noalias(current_part, current_mem->desc);
|
||||
if (existing_mem != NULL) {
|
||||
lrmv_d(current_part->mem, existing_mem);
|
||||
avr_free_mem(existing_mem);
|
||||
}
|
||||
if (is_alias) {
|
||||
avr_free_mem(current_mem); // alias mem has been already entered below
|
||||
{
|
||||
if (is_alias) { // alias mem has been already entered
|
||||
lrmv_d(current_part->mem, current_mem);
|
||||
avr_free_mem(current_mem);
|
||||
is_alias = false;
|
||||
} else {
|
||||
ladd(current_part->mem, current_mem);
|
||||
}
|
||||
current_mem = NULL;
|
||||
} |
|
||||
|
|
Loading…
Reference in New Issue