From 4a55a6583ab48a52fa590ec1d8cfba123d2ec0e8 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 1 Sep 2006 10:03:12 +0000 Subject: [PATCH] * butterfly.c: Remove the device support decision based on the old AVR910 device codes; we've got signature verification now so better rely on that. * avr910.c: Revert the signature bytes returned, as it already happened in butterfly.c. This closes bug #14998: Signature Bytes read in wrong order (avr910 mode) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@638 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 9 +++++++++ avr910.c | 6 ++++++ butterfly.c | 19 ++----------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index b43895ae..ce59380f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-09-01 Joerg Wunsch + + * butterfly.c: Remove the device support decision based on + the old AVR910 device codes; we've got signature verification + now so better rely on that. + * avr910.c: Revert the signature bytes returned, as it already + happened in butterfly.c. This closes bug #14998: Signature Bytes + read in wrong order (avr910 mode) + 2006-09-01 Joerg Wunsch Submitted by Wim Lewis. diff --git a/avr910.c b/avr910.c index 5250fb99..c61de2b5 100644 --- a/avr910.c +++ b/avr910.c @@ -557,6 +557,8 @@ static int avr910_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, static int avr910_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) { + unsigned char tmp; + if (m->size < 3) { fprintf(stderr, "%s: memsize too small for sig byte read", progname); return -1; @@ -564,6 +566,10 @@ static int avr910_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) avr910_send(pgm, "s", 1); avr910_recv(pgm, (char *)m->buf, 3); + /* Returned signature has wrong order. */ + tmp = m->buf[2]; + m->buf[2] = m->buf[0]; + m->buf[0] = tmp; return 3; } diff --git a/butterfly.c b/butterfly.c index 26728065..2f9bccc7 100644 --- a/butterfly.c +++ b/butterfly.c @@ -227,7 +227,6 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) char buf[10]; char type; char c; - int dev_supported = 0; no_show_func_info(); @@ -313,22 +312,9 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) if (c == 0) break; fprintf(stderr, " Device code: 0x%02x\n", (unsigned int)(unsigned char)c); - - /* FIXME: Need to lookup devcode and report the device. */ - - if (p->avr910_devcode == (int)(unsigned char)c) - dev_supported = 1; }; fprintf(stderr,"\n"); - if (!dev_supported) { - /* FIXME: if nothing matched, we should rather compare the device - signatures. */ - fprintf(stderr, - "%s: error: selected device is not supported by programmer: %s\n", - progname, p->id); - } - /* Tell the programmer which part we selected. */ buf[0] = 'T'; @@ -337,10 +323,9 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) butterfly_send(pgm, buf, 2); butterfly_vfy_cmd_sent(pgm, "select device"); - if (dev_supported) - butterfly_enter_prog_mode(pgm); + butterfly_enter_prog_mode(pgm); - return dev_supported? 0: -1; + return 0; }