Provide self-documenting API for disabling trailing-0xff removal

This commit is contained in:
Stefan Rueger 2022-04-28 17:26:09 +01:00
parent 2397984d2b
commit 52b20f4a28
3 changed files with 3 additions and 3 deletions

View File

@ -131,6 +131,5 @@ void arduino_initpgm(PROGRAMMER * pgm)
pgm->open = arduino_open; pgm->open = arduino_open;
pgm->close = arduino_close; pgm->close = arduino_close;
/* disable trailing-0xff removal when reading input files and avr flash */ disable_trailing_ff_removal(); /* so that arduino bootloader can ignore chip erase */
avr_mem_hiaddr(NULL);
} }

View File

@ -787,6 +787,7 @@ int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles);
int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles); int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles);
#define disable_trailing_ff_removal() avr_mem_hiaddr(NULL)
int avr_mem_hiaddr(AVRMEM * mem); int avr_mem_hiaddr(AVRMEM * mem);
int avr_chip_erase(PROGRAMMER * pgm, AVRPART * p); int avr_chip_erase(PROGRAMMER * pgm, AVRPART * p);

View File

@ -528,7 +528,7 @@ int main(int argc, char * argv [])
case 'D': /* disable auto erase */ case 'D': /* disable auto erase */
uflags &= ~UF_AUTO_ERASE; uflags &= ~UF_AUTO_ERASE;
avr_mem_hiaddr(NULL); /* disable trailing 0xff optimisation */ disable_trailing_ff_removal();
break; break;
case 'e': /* perform a chip erase */ case 'e': /* perform a chip erase */