Merge pull request #1023 from stefanrueger/issue1004

Fix PICKit2 ATmega2560 flash paged flash read
This commit is contained in:
Stefan Rueger 2022-07-12 14:51:56 +01:00 committed by GitHub
commit e867486f3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -491,18 +491,15 @@ static int pickit2_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
pgm->pgm_led(pgm, ON);
if (lext) {
memset(cmd, 0, sizeof(cmd));
avr_set_bits(lext, cmd);
avr_set_addr(lext, cmd, addr/2);
pgm->cmd(pgm, cmd, res);
}
for (addr_base = addr; addr_base < max_addr; )
{
if ((addr_base == 0 || (addr_base % /*ext_address_boundary*/ 65536) == 0)
&& lext != NULL)
{
memset(cmd, 0, sizeof(cmd));
avr_set_bits(lext, cmd);
avr_set_addr(lext, cmd, addr_base);
pgm->cmd(pgm, cmd, res);
}
// bytes to send in the next packet -- not necessary as pickit2_spi() handles breaking up
// the data into packets -- but we need to keep transfers frequent so that we can update the
// status indicator bar