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:
parent
2b2dde9f98
commit
0521de7655
9
main.c
9
main.c
@ -502,7 +502,7 @@ int main(void)
|
|||||||
if (val == 'a') {
|
if (val == 'a') {
|
||||||
response = 'Y';
|
response = 'Y';
|
||||||
|
|
||||||
/* write address */
|
/* write address: flash:words, eeprom:bytes */
|
||||||
} else if (val == 'A') {
|
} else if (val == 'A') {
|
||||||
address = (recvchar() << 8);
|
address = (recvchar() << 8);
|
||||||
address |= recvchar();
|
address |= recvchar();
|
||||||
@ -528,8 +528,11 @@ int main(void)
|
|||||||
*data++ = (count < size) ? recvchar() : 0xFF;
|
*data++ = (count < size) ? recvchar() : 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((val == 'F') && (address < BOOTLOADER_START)) {
|
|
||||||
|
if ((val == 'F') && (address < (BOOTLOADER_START >> 1))) {
|
||||||
|
address <<= 1;
|
||||||
writeFlashPage(size);
|
writeFlashPage(size);
|
||||||
|
address >>= 1;
|
||||||
response = '\r';
|
response = '\r';
|
||||||
|
|
||||||
} else if ((val == 'E') && (address < E2END)) {
|
} else if ((val == 'E') && (address < E2END)) {
|
||||||
@ -549,7 +552,9 @@ int main(void)
|
|||||||
val = recvchar();
|
val = recvchar();
|
||||||
|
|
||||||
if (val == 'F') {
|
if (val == 'F') {
|
||||||
|
address <<= 1;
|
||||||
readSendFlashPage(size);
|
readSendFlashPage(size);
|
||||||
|
address >>= 1;
|
||||||
|
|
||||||
} else if (val == 'E') {
|
} else if (val == 'E') {
|
||||||
readSendEEpromPage(size);
|
readSendEEpromPage(size);
|
||||||
|
Loading…
Reference in New Issue
Block a user