Merge pull request #784 from mariusgreuel/pr-bugfix-avr_read

Fix avr_read() for page reads

Closes issue #481
This commit is contained in:
Jörg Wunsch 2021-12-26 18:34:39 +01:00 committed by GitHub
commit 5520bd6711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -331,7 +331,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
/* supports "paged load" thru post-increment */ /* supports "paged load" thru post-increment */
if ((p->flags & AVRPART_HAS_TPI) && mem->page_size > 1 && if ((p->flags & AVRPART_HAS_TPI) && mem->page_size > 1 &&
pgm->cmd_tpi != NULL) { mem->size % mem->page_size == 0 && pgm->cmd_tpi != NULL) {
while (avr_tpi_poll_nvmbsy(pgm)); while (avr_tpi_poll_nvmbsy(pgm));
@ -361,7 +361,8 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
return avr_mem_hiaddr(mem); return avr_mem_hiaddr(mem);
} }
if (pgm->paged_load != NULL && mem->page_size > 1) { if (pgm->paged_load != NULL && mem->page_size > 1 &&
mem->size % mem->page_size == 0) {
/* /*
* the programmer supports a paged mode read * the programmer supports a paged mode read
*/ */