Utilise avr_has_paged_write() and ..._load()

This commit is contained in:
stefanrueger
2026-02-28 16:05:32 +01:00
parent 33530161fa
commit acbbb55fb9
2 changed files with 5 additions and 4 deletions

View File

@@ -420,7 +420,8 @@ int avr_read_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, con
// HW programmers need a page size > 1, bootloader typ only offer paged r/w
if((pgm->paged_load && mem->page_size > 1 && mem->size%mem->page_size == 0) ||
(is_spm(pgm) && avr_has_paged_access(pgm, p, mem))) {
(is_spm(pgm) && avr_has_paged_load(pgm, p, mem))) {
// The programmer supports a paged mode read
int need_read, failure;
unsigned int pageaddr;
@@ -1025,7 +1026,7 @@ int avr_write_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, int
}
// HW programmers need a page size > 1, bootloader typ only offer paged r/w
if((pgm->paged_write && m->page_size > 1 && m->size%m->page_size == 0) ||
(is_spm(pgm) && avr_has_paged_access(pgm, p, m))) {
(is_spm(pgm) && avr_has_paged_write(pgm, p, m))) {
// The programmer supports a paged mode write
int need_write, failure, nset;

View File

@@ -156,7 +156,7 @@ int avr_has_paged_load(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *me
* + LIBAVRDUDE_SUCCESS (0) if the fallback of bytewise read succeeded
*/
int avr_read_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, unsigned char *buf) {
if(!avr_has_paged_access(pgm, p, mem) || addr < 0 || addr >= mem->size)
if(!avr_has_paged_load(pgm, p, mem) || addr < 0 || addr >= mem->size)
return LIBAVRDUDE_GENERAL_FAILURE;
int rc, pgsize = mem->page_size, base = addr & ~(pgsize - 1);
@@ -201,7 +201,7 @@ int avr_read_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM
* - Uses write_byte() if memory page size is one, otherwise paged_write()
*/
int avr_write_page_default(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, int addr, unsigned char *data) {
if(!avr_has_paged_access(pgm, p, mem) || addr < 0 || addr >= mem->size)
if(!avr_has_paged_write(pgm, p, mem) || addr < 0 || addr >= mem->size)
return LIBAVRDUDE_GENERAL_FAILURE;
int rc, pgsize = mem->page_size, base = addr & ~(pgsize - 1);