bug #60753: Patch #1436 breaks multiple programmer/device combinations on MacOS BigSur

* avr.c: compare page_size > 1 instead of != 0
* stk500v2.c: (Ditto.)




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1452 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2021-06-27 20:26:05 +00:00
parent 69a771317f
commit 38e5aa33ea
4 changed files with 17 additions and 11 deletions

View File

@ -0,0 +1,5 @@
2021-06-27 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #60753: Patch #1436 breaks multiple programmer/device combinations on MacOS BigSur
* avr.c: compare page_size > 1 instead of != 0
* stk500v2.c: (Ditto.)

1
NEWS
View File

@ -50,6 +50,7 @@ Current:
bug #57428: document when 'arduino' or 'wiring' should be used, and -D requirement of latter
bug #58095: error setting efuse on atmega328pb variant
no-id: efuse section on ATmega32M1 lacks 'size'
bug #60753: Patch #1436 breaks multiple programmer/device combinations on MacOS BigSur
* Patches:
patch #9482: Add support for UPDI and AVR8X

8
avr.c
View File

@ -330,7 +330,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
memset(mem->buf, 0xff, mem->size);
/* supports "paged load" thru post-increment */
if ((p->flags & AVRPART_HAS_TPI) && mem->page_size != 0 &&
if ((p->flags & AVRPART_HAS_TPI) && mem->page_size > 1 &&
pgm->cmd_tpi != NULL) {
while (avr_tpi_poll_nvmbsy(pgm));
@ -361,7 +361,7 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
return avr_mem_hiaddr(mem);
}
if (pgm->paged_load != NULL && mem->page_size != 0) {
if (pgm->paged_load != NULL && mem->page_size > 1) {
/*
* the programmer supports a paged mode read
*/
@ -863,7 +863,7 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
}
if ((p->flags & AVRPART_HAS_TPI) && m->page_size != 0 &&
if ((p->flags & AVRPART_HAS_TPI) && m->page_size > 1 &&
pgm->cmd_tpi != NULL) {
while (avr_tpi_poll_nvmbsy(pgm));
@ -903,7 +903,7 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
return i;
}
if (pgm->paged_write != NULL && m->page_size != 0) {
if (pgm->paged_write != NULL && m->page_size > 1) {
/*
* the programmer supports a paged mode write
*/

View File

@ -1290,14 +1290,14 @@ static int stk500v2_initialize(PROGRAMMER * pgm, AVRPART * p)
for (ln = lfirst(p->mem); ln; ln = lnext(ln)) {
m = ldata(ln);
if (strcmp(m->desc, "flash") == 0) {
if (m->page_size > 0) {
if (m->page_size > 1) {
if (m->page_size > 256)
PDATA(pgm)->flash_pagesize = 256;
else
PDATA(pgm)->flash_pagesize = m->page_size;
}
} else if (strcmp(m->desc, "eeprom") == 0) {
if (m->page_size > 0)
if (m->page_size > 1)
PDATA(pgm)->eeprom_pagesize = m->page_size;
}
}
@ -1389,14 +1389,14 @@ static int stk500v2_jtag3_initialize(PROGRAMMER * pgm, AVRPART * p)
for (ln = lfirst(p->mem); ln; ln = lnext(ln)) {
m = ldata(ln);
if (strcmp(m->desc, "flash") == 0) {
if (m->page_size > 0) {
if (m->page_size > 1) {
if (m->page_size > 256)
PDATA(pgm)->flash_pagesize = 256;
else
PDATA(pgm)->flash_pagesize = m->page_size;
}
} else if (strcmp(m->desc, "eeprom") == 0) {
if (m->page_size > 0)
if (m->page_size > 1)
PDATA(pgm)->eeprom_pagesize = m->page_size;
}
}
@ -1460,14 +1460,14 @@ static int stk500hv_initialize(PROGRAMMER * pgm, AVRPART * p, enum hvmode mode)
for (ln = lfirst(p->mem); ln; ln = lnext(ln)) {
m = ldata(ln);
if (strcmp(m->desc, "flash") == 0) {
if (m->page_size > 0) {
if (m->page_size > 1) {
if (m->page_size > 256)
PDATA(pgm)->flash_pagesize = 256;
else
PDATA(pgm)->flash_pagesize = m->page_size;
}
} else if (strcmp(m->desc, "eeprom") == 0) {
if (m->page_size > 0)
if (m->page_size > 1)
PDATA(pgm)->eeprom_pagesize = m->page_size;
}
}
@ -3731,7 +3731,7 @@ static int stk600_xprog_program_enable(PROGRAMMER * pgm, AVRPART * p)
return -1;
}
if ((mem = avr_locate_mem(p, "eeprom")) != NULL) {
if (mem->page_size == 0) {
if (mem->page_size <= 1) {
avrdude_message(MSG_INFO, "%s: stk600_xprog_program_enable(): no EEPROM page_size parameter for PDI device\n",
progname);
return -1;