diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 5a04a6b5..1bdf5da0 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,9 @@ +2013-09-13 Joerg Wunsch + + patch #8176: butterfly.c (AVR109 protocol implementation) clean-up and bug-fixing + * butterfly.c (butterfly_page_erase): Add dummy function to avoid + segfault when writing to EEPROM. + 2013-09-13 Joerg Wunsch bug #35474 Feature request: print fuse values in safemode output diff --git a/avrdude/butterfly.c b/avrdude/butterfly.c index db4098a5..ac4c558b 100644 --- a/avrdude/butterfly.c +++ b/avrdude/butterfly.c @@ -544,6 +544,17 @@ static int butterfly_read_byte_eeprom(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, return 0; } +static int butterfly_page_erase(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsigned int addr) +{ + if (strcmp(m->desc, "flash") == 0) + return -1; /* not supported */ + if (strcmp(m->desc, "eeprom") == 0) + return 0; /* nothing to do */ + fprintf(stderr, + "%s: butterfly_page_erase() called on memory type \"%s\"\n", + progname, m->desc); + return -1; +} static int butterfly_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, unsigned long addr, unsigned char * value) @@ -729,6 +740,7 @@ void butterfly_initpgm(PROGRAMMER * pgm) * optional functions */ + pgm->page_erase = butterfly_page_erase; pgm->paged_write = butterfly_paged_write; pgm->paged_load = butterfly_paged_load;