diff --git a/src/config_gram.y b/src/config_gram.y index 07024000..fe9ecbbb 100644 --- a/src/config_gram.y +++ b/src/config_gram.y @@ -378,6 +378,10 @@ part_def : yywarning("revise fileio_mem_offset(), avrdude.conf entry or memory type assignment"); } + // Sort memories in canonical order + if(current_part->mem) + lsort(current_part->mem, avr_mem_cmp); + existing_part = locate_part(part_list, current_part->id); if(existing_part) { { /* temporarily set lineno to lineno of part start */ diff --git a/src/main.c b/src/main.c index d2a430c4..f239c129 100644 --- a/src/main.c +++ b/src/main.c @@ -1184,11 +1184,6 @@ int main(int argc, char *argv[]) { } } - // Sort memories of all parts in canonical order - for(LNODEID ln1 = lfirst(part_list); ln1; ln1 = lnext(ln1)) - if((p = ldata(ln1))->mem) - lsort(p->mem, avr_mem_cmp); - // Set bitclock from configuration files unless changed by command line if(default_bitclock > 0 && bitclock == 0.0) { bitclock = default_bitclock;