bug #43137: Writing and reading incorrect pages when using jtagicemkI

* jtagmkI.c (jtagmkI_paged_write, jtagmkI_paged_load): correctly
calculate the size of a partial (non-pagesize) buffer



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1345 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2014-11-23 20:57:17 +00:00
parent 48c365e31c
commit fcc716e1a7
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #43137: Writing and reading incorrect pages when using jtagicemkI
* jtagmkI.c (jtagmkI_paged_write, jtagmkI_paged_load): correctly
calculate the size of a partial (non-pagesize) buffer
2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2014-11-23 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #43078: AVRDUDE crashes after sucessfully reading/writing eeprom bug #43078: AVRDUDE crashes after sucessfully reading/writing eeprom

1
NEWS
View File

@ -27,6 +27,7 @@ Current:
- bug #41561: AVRDUDE 6.0.1/USBasp doesn't write first bytes of - bug #41561: AVRDUDE 6.0.1/USBasp doesn't write first bytes of
flash page flash page
- bug #43078: AVRDUDE crashes after sucessfully reading/writing eeprom - bug #43078: AVRDUDE crashes after sucessfully reading/writing eeprom
- bug #43137: Writing and reading incorrect pages when using jtagicemkI
* Internals: * Internals:
- ... - ...

View File

@ -766,8 +766,8 @@ static int jtagmkI_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
return -1; return -1;
} }
if ((n_bytes-addr) < page_size) if (n_bytes < page_size)
block_size = n_bytes - addr; block_size = n_bytes;
else else
block_size = page_size; block_size = page_size;
avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_write(): " avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_write(): "
@ -886,8 +886,8 @@ static int jtagmkI_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
return -1; return -1;
} }
if ((n_bytes-addr) < page_size) if (n_bytes < page_size)
block_size = n_bytes - addr; block_size = n_bytes;
else else
block_size = page_size; block_size = page_size;
avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_load(): " avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_load(): "