Attached is the patch that makes avrdude skip pages that only 
contain 0xff. This speeds up programming enormously if
you have a program that loads at the end of the flash. 

        Roger. 
-- 
** [EMAIL PROTECTED] ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement. 
Does it sit on the couch all day? Is it unemployed? Please be specific! 
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ
--- avrdude-5.3.1-orig/avr.c    2006-12-11 15:06:52.000000000 +0100
+++ avrdude-5.3.1/avr.c 2007-04-14 17:27:52.000000000 +0200
@@ -547,6 +547,7 @@
   unsigned char    data;
   int              werror;
   AVRMEM         * m;
+  int j;
 
   m = avr_locate_mem(p, memtype);
   if (m == NULL) {
@@ -589,6 +590,23 @@
   }
 
   for (i=0; i<wsize; i++) {
+
+    if (m->paged) {
+      /*
+       * check to see if it is time to flush the page with a page
+       * write
+       */
+      if ((i % m->page_size) == 0) {
+       for (j=0;j<m->page_size;j++)
+         if (m->buf[i+j] != 0xff) break;
+
+       if (j == m->page_size) {
+         i += m->page_size-1;
+         continue;
+       }
+      }
+    }
+
     data = m->buf[i];
     report_progress(i, wsize, NULL);
 
_______________________________________________
AVR-chat mailing list
[EMAIL PROTECTED]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to