diff --git a/src/arduino.c b/src/arduino.c index 7f030a13..f7b60246 100644 --- a/src/arduino.c +++ b/src/arduino.c @@ -131,6 +131,5 @@ void arduino_initpgm(PROGRAMMER * pgm) pgm->open = arduino_open; pgm->close = arduino_close; - /* disable trailing-0xff removal when reading input files and avr flash */ - avr_mem_hiaddr(NULL); + disable_trailing_ff_removal(); /* so that arduino bootloader can ignore chip erase */ } diff --git a/src/libavrdude.h b/src/libavrdude.h index ddb72b48..d8d5739a 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -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); +#define disable_trailing_ff_removal() avr_mem_hiaddr(NULL) int avr_mem_hiaddr(AVRMEM * mem); int avr_chip_erase(PROGRAMMER * pgm, AVRPART * p); diff --git a/src/main.c b/src/main.c index c3bc0381..526ae35f 100644 --- a/src/main.c +++ b/src/main.c @@ -528,7 +528,7 @@ int main(int argc, char * argv []) case 'D': /* disable auto erase */ uflags &= ~UF_AUTO_ERASE; - avr_mem_hiaddr(NULL); /* disable trailing 0xff optimisation */ + disable_trailing_ff_removal(); break; case 'e': /* perform a chip erase */