fix address command

For flash the 'A'ddress command sends word offset instead of byte offset.
related to avrdude bug #38951: AVR109 use byte offset instead of word offset
This commit is contained in:
Olaf Rempel 2016-05-15 23:11:11 +02:00
parent 2b2dde9f98
commit 0521de7655

9
main.c
View File

@ -502,7 +502,7 @@ int main(void)
if (val == 'a') {
response = 'Y';
/* write address */
/* write address: flash:words, eeprom:bytes */
} else if (val == 'A') {
address = (recvchar() << 8);
address |= recvchar();
@ -528,8 +528,11 @@ int main(void)
*data++ = (count < size) ? recvchar() : 0xFF;
}
if ((val == 'F') && (address < BOOTLOADER_START)) {
if ((val == 'F') && (address < (BOOTLOADER_START >> 1))) {
address <<= 1;
writeFlashPage(size);
address >>= 1;
response = '\r';
} else if ((val == 'E') && (address < E2END)) {
@ -549,7 +552,9 @@ int main(void)
val = recvchar();
if (val == 'F') {
address <<= 1;
readSendFlashPage(size);
address >>= 1;
} else if (val == 'E') {
readSendEEpromPage(size);