Fix a bug introduced in rev. 1.69, when implementing the
fallback from each programmer's paged_load() or paged_write() method, respectively. The return value needs to be checked for being greater or equal than 0 rather equal to 0 in order to assume the operation has been successful. Fixes bug #18489: avrdude is too slow (20 byte/s) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@695 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
31fa98b708
commit
4beee5ff79
|
@ -1,3 +1,12 @@
|
||||||
|
2006-12-11 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||||
|
|
||||||
|
* avr.c: Fix a bug introduced in rev. 1.69, when implementing the
|
||||||
|
fallback from each programmer's paged_load() or paged_write()
|
||||||
|
method, respectively. The return value needs to be checked for
|
||||||
|
being greater or equal than 0 rather equal to 0 in order to
|
||||||
|
assume the operation has been successful.
|
||||||
|
Fixes bug #18489: avrdude is too slow (20 byte/s)
|
||||||
|
|
||||||
2006-12-11 Joerg Wunsch <j@uriah.heep.sax.de>
|
2006-12-11 Joerg Wunsch <j@uriah.heep.sax.de>
|
||||||
|
|
||||||
* avr910.c: Make the code compile warning-free:
|
* avr910.c: Make the code compile warning-free:
|
||||||
|
|
4
avr.c
4
avr.c
|
@ -183,7 +183,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
||||||
* instead
|
* instead
|
||||||
*/
|
*/
|
||||||
rc = pgm->paged_load(pgm, p, mem, mem->page_size, size);
|
rc = pgm->paged_load(pgm, p, mem, mem->page_size, size);
|
||||||
if (rc == 0) {
|
if (rc >= 0) {
|
||||||
if (strcasecmp(mem->desc, "flash") == 0)
|
if (strcasecmp(mem->desc, "flash") == 0)
|
||||||
return avr_mem_hiaddr(mem);
|
return avr_mem_hiaddr(mem);
|
||||||
else
|
else
|
||||||
|
@ -579,7 +579,7 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
||||||
* efficiently than we can read it directly, so use its routine
|
* efficiently than we can read it directly, so use its routine
|
||||||
* instead
|
* instead
|
||||||
*/
|
*/
|
||||||
if (pgm->paged_write(pgm, p, m, m->page_size, size) == 0)
|
if (pgm->paged_write(pgm, p, m, m->page_size, size) >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue