1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-30 19:12:48 +02:00
ben-blinkenlights/avrdude/patches/skip-low-addr.patch
Werner Almesberger d7874e306c avrdude/patches/: added skipping of untouched bytes in write/verify
- series, low-addr.patch: record the lowest address touched (only for
  ihex, all others default to 0)
- series, skip-low-addr.patch: skip untouched addresses in avr_read
  and avr_write
2011-03-09 01:50:51 -03:00

37 lines
1.3 KiB
Diff

Index: avrdude/avrdude-5.10/avr.c
===================================================================
--- avrdude.orig/avrdude-5.10/avr.c 2011-03-08 23:46:53.000000000 -0300
+++ avrdude/avrdude-5.10/avr.c 2011-03-08 23:50:06.000000000 -0300
@@ -192,7 +192,8 @@
}
}
- for (i=0; i<size; i++) {
+ i = mem->paged ? mem->low_addr : 0;
+ for (; i<size; i++) {
rc = pgm->read_byte(pgm, p, mem, i, &rbyte);
if (rc != 0) {
fprintf(stderr, "avr_read(): error reading address 0x%04lx\n", i);
@@ -580,7 +581,8 @@
pgm->write_setup(pgm, p, m);
}
- for (i=0; i<wsize; i++) {
+ i = m->paged ? m->low_addr-(m->low_addr % m->page_size) : 0;
+ for (; i<wsize; i++) {
data = m->buf[i];
report_progress(i, wsize, NULL);
Index: avrdude/avrdude-5.10/update.c
===================================================================
--- avrdude.orig/avrdude-5.10/update.c 2011-03-08 23:46:53.000000000 -0300
+++ avrdude/avrdude-5.10/update.c 2011-03-08 23:47:45.000000000 -0300
@@ -224,6 +224,7 @@
progname, mem->desc);
}
report_progress(0,1,"Reading");
+ mem->low_addr = 0; /* @@@ hackish */
rc = avr_read(pgm, p, upd->memtype, 0, 1);
if (rc < 0) {
fprintf(stderr, "%s: failed to read all of %s memory, rc=%d\n",