In avr_read() and avr_write(), if the paged access returns a
failure, fall back to byte access. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@692 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
4bbd40415d
commit
aef8e953ab
|
@ -1,3 +1,8 @@
|
|||
2006-11-23 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* avr.c (avr_read, avr_write): if the paged access returns a
|
||||
failure, fall back to byte access.
|
||||
|
||||
2006-11-21 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||
|
||||
* jtagmkII.c: In jtagmkII_read_byte() and jtagmkII_write_byte(),
|
||||
|
|
22
avr.c
22
avr.c
|
@ -182,20 +182,13 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
|||
* efficiently than we can read it directly, so use its routine
|
||||
* instead
|
||||
*/
|
||||
if (mem->paged) {
|
||||
rc = pgm->paged_load(pgm, p, mem, mem->page_size, size);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
rc = pgm->paged_load(pgm, p, mem, mem->page_size, size);
|
||||
if (rc == 0) {
|
||||
if (strcasecmp(mem->desc, "flash") == 0)
|
||||
return avr_mem_hiaddr(mem);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
rc = pgm->paged_load(pgm, p, mem, pgm->page_size, size);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
}
|
||||
if (strcasecmp(mem->desc, "flash") == 0)
|
||||
return avr_mem_hiaddr(mem);
|
||||
else
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -586,7 +579,8 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
|||
* efficiently than we can read it directly, so use its routine
|
||||
* instead
|
||||
*/
|
||||
return pgm->paged_write(pgm, p, m, m->page_size, size);
|
||||
if (pgm->paged_write(pgm, p, m, m->page_size, size) == 0)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue