bug #35456 The progress bar for STK500V2 programmer is "wrong".

* avr.c (avr_read, avr_write): Change the progress reporting for
paged read/write from per-address to per-considered-page.  This
ought to give a realistic estimation about the time still to be
spent.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1220 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2013-09-13 09:42:47 +00:00
parent 5113b8051a
commit 9697ebe2ec
3 changed files with 49 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #35456 The progress bar for STK500V2 programmer is "wrong".
* avr.c (avr_read, avr_write): Change the progress reporting for
paged read/write from per-address to per-considered-page. This
ought to give a realistic estimation about the time still to be
spent.
2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2013-09-13 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #34277: avrdude reads wrong byte order if using avr911 (aka butterfly) bug #34277: avrdude reads wrong byte order if using avr911 (aka butterfly)

9
NEWS
View File

@ -88,14 +88,15 @@ Current:
- bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4 - bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4
- bug #35800: Compilation error on certain systems if parport is disabled - bug #35800: Compilation error on certain systems if parport is disabled
- bug #38307: Can't write usersig of an xmega256a3 - bug #38307: Can't write usersig of an xmega256a3
- bug #38580 Current svn head, xmega and fuses, all fuses tied to fuse0 - bug #38580: Current svn head, xmega and fuses, all fuses tied to fuse0
- bug #39691 Buffer overrun when reading EEPROM byte with JTAGICE3 - bug #39691: Buffer overrun when reading EEPROM byte with JTAGICE3
- bug #38951: AVR109 use byte offset instead of word offset - bug #38951: AVR109 use byte offset instead of word offset
- patch #7769: Write flash fails for AVR910 programmers - patch #7769: Write flash fails for AVR910 programmers
- bug #38732: Support for ATtiny1634 - bug #38732: Support for ATtiny1634
- bug #36901 flashing Atmega32U4 EEPROM produces garbage on chip - bug #36901: flashing Atmega32U4 EEPROM produces garbage on chip
- bug #28344 chip_erase_delay too short for ATmega324P, 644, 644P, and 1284P - bug #28344: chip_erase_delay too short for ATmega324P, 644, 644P, and 1284P
- bug #34277: avrdude reads wrong byte order if using avr911 (aka butterfly) - bug #34277: avrdude reads wrong byte order if using avr911 (aka butterfly)
- bug #35456: The progress bar for STK500V2 programmer is "wrong".
* Keep track of input file contents * Keep track of input file contents

40
avr.c
View File

@ -373,8 +373,23 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
*/ */
int need_read, failure; int need_read, failure;
unsigned int pageaddr; unsigned int pageaddr;
unsigned int npages, nread;
for (pageaddr = 0, failure = 0; /* quickly scan number of pages to be written to first */
for (pageaddr = 0, npages = 0;
pageaddr < mem->size;
pageaddr += mem->page_size) {
/* check whether this page must be read */
for (i = pageaddr;
i < pageaddr + mem->page_size;
i++)
if ((mem->tags[i] & TAG_ALLOCATED) != 0) {
npages++;
break;
}
}
for (pageaddr = 0, failure = 0, nread = 0;
!failure && pageaddr < mem->size; !failure && pageaddr < mem->size;
pageaddr += mem->page_size) { pageaddr += mem->page_size) {
/* check whether this page must be read */ /* check whether this page must be read */
@ -400,7 +415,8 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
"%s: avr_read(): skipping page %u: no interesting data\n", "%s: avr_read(): skipping page %u: no interesting data\n",
progname, pageaddr / mem->page_size); progname, pageaddr / mem->page_size);
} }
report_progress(pageaddr, mem->size, NULL); nread++;
report_progress(nread, npages, NULL);
} }
if (!failure) { if (!failure) {
if (strcasecmp(mem->desc, "flash") == 0 || if (strcasecmp(mem->desc, "flash") == 0 ||
@ -901,8 +917,23 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
*/ */
int need_write, failure; int need_write, failure;
unsigned int pageaddr; unsigned int pageaddr;
unsigned int npages, nwritten;
for (pageaddr = 0, failure = 0; /* quickly scan number of pages to be written to first */
for (pageaddr = 0, npages = 0;
pageaddr < wsize;
pageaddr += m->page_size) {
/* check whether this page must be written to */
for (i = pageaddr;
i < pageaddr + m->page_size;
i++)
if ((m->tags[i] & TAG_ALLOCATED) != 0) {
npages++;
break;
}
}
for (pageaddr = 0, failure = 0, nwritten = 0;
!failure && pageaddr < wsize; !failure && pageaddr < wsize;
pageaddr += m->page_size) { pageaddr += m->page_size) {
/* check whether this page must be written to */ /* check whether this page must be written to */
@ -927,7 +958,8 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
"%s: avr_write(): skipping page %u: no interesting data\n", "%s: avr_write(): skipping page %u: no interesting data\n",
progname, pageaddr / m->page_size); progname, pageaddr / m->page_size);
} }
report_progress(pageaddr, m->size, NULL); nwritten++;
report_progress(nwritten, npages, NULL);
} }
if (!failure) if (!failure)
return wsize; return wsize;