From a8e82b7e49e502de262abbbb07a67bfd7e4fde2a Mon Sep 17 00:00:00 2001 From: joerg_wunsch Date: Thu, 15 Sep 2011 11:15:06 +0000 Subject: [PATCH] * avr.c (avr_read, avr_write): Don't bail out on TPI parts if their programmer doesn't provide a (low-level) cmd_tpi method; instead, fall back to the normal programmer methods which are supposed to handle the situation. This fixes a regression where the recent bitbang-TPI implementation broke TPI handling of STK600/AVRISPmkII. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1008 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 9 +++++++++ avr.c | 17 ++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 803467f4..180dd397 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-09-15 Joerg Wunsch + + * avr.c (avr_read, avr_write): Don't bail out on TPI parts if + their programmer doesn't provide a (low-level) cmd_tpi method; + instead, fall back to the normal programmer methods which are + supposed to handle the situation. + This fixes a regression where the recent bitbang-TPI implementation + broke TPI handling of STK600/AVRISPmkII. + 2011-09-13 Joerg Wunsch * stk500v2.c (stk500v2_command): Treat warnings as errors rather than diff --git a/avr.c b/avr.c index d5fdde3c..bdacf28f 100644 --- a/avr.c +++ b/avr.c @@ -235,12 +235,8 @@ 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 (pgm->cmd_tpi == NULL) { - fprintf(stderr, "%s: Error: %s programmer does not support TPI\n", - progname, pgm->type); - return -1; - } + if ((p->flags & AVRPART_HAS_TPI) && mem->page_size != 0 && + pgm->cmd_tpi != NULL) { while (avr_tpi_poll_nvmbsy(pgm)); @@ -752,13 +748,8 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size, } - if ((p->flags & AVRPART_HAS_TPI) && m->page_size != 0) { - if (pgm->cmd_tpi == NULL) { - fprintf(stderr, - "%s: Error: %s programmer does not support TPI\n", - progname, pgm->type); - return -1; - } + if ((p->flags & AVRPART_HAS_TPI) && m->page_size != 0 && + pgm->cmd_tpi != NULL) { while (avr_tpi_poll_nvmbsy(pgm));