Merge pull request #1141 from stefanrueger/paged

Always use paged access for programmers that serve bootloaders
This commit is contained in:
Stefan Rueger 2022-10-23 22:33:31 +01:00 committed by GitHub
commit ae5b460859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -377,8 +377,9 @@ int avr_read_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, con
return avr_mem_hiaddr(mem); return avr_mem_hiaddr(mem);
} }
if (pgm->paged_load != NULL && mem->page_size > 1 && // HW programmers need a page size > 1, bootloader typ only offer paged r/w
mem->size % mem->page_size == 0) { if ((pgm->paged_load && mem->page_size > 1 && mem->size % mem->page_size == 0) ||
((pgm->prog_modes & PM_SPM) && avr_has_paged_access(pgm, mem))) {
/* /*
* the programmer supports a paged mode read * the programmer supports a paged mode read
*/ */
@ -894,7 +895,9 @@ int avr_write_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, int
return i; return i;
} }
if (pgm->paged_write != NULL && m->page_size > 1) { // HW programmers need a page size > 1, bootloader typ only offer paged r/w
if ((pgm->paged_load && m->page_size > 1 && m->size % m->page_size == 0) ||
((pgm->prog_modes & PM_SPM) && avr_has_paged_access(pgm, m))) {
/* /*
* the programmer supports a paged mode write * the programmer supports a paged mode write
*/ */