Initialize progress reporting in avr_{read,write}_mem

Progress reporting needs to be initialized by passing it a "header"
string, in order to re-adjust internal static variables.
avr_{read,write}_mem did not do this, so they only reported progress
upon the very first invocation.
This commit is contained in:
Joerg Wunsch
2024-03-18 20:55:19 +01:00
parent 68d44ea1e6
commit 296883cf1a

View File

@@ -367,6 +367,7 @@ int avr_read_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, con
* start with all 0xff
*/
memset(mem->buf, 0xff, mem->size);
report_progress(0, 1, "Reading");
/* supports "paged load" thru post-increment */
if ((p->prog_modes & PM_TPI) && mem->page_size > 1 &&
@@ -968,6 +969,7 @@ int avr_write_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, int
return wsize;
}
report_progress(0, 1, "Writing");
if ((p->prog_modes & PM_TPI) && m->page_size > 1 && pgm->cmd_tpi) {
unsigned int chunk; /* number of words for each write command */
unsigned int j, writeable_chunk;