From 1dfa7127da9565eec3596533c7c89ecb474afe62 Mon Sep 17 00:00:00 2001 From: Jan-Hinnerk Reichert Date: Mon, 12 Jan 2004 22:48:50 +0000 Subject: [PATCH] * avr910.c, avrpart.c, avrpart.h, doc/TODO: Look up devicecode and report device. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@399 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 5 +++++ avrdude/avr910.c | 5 ++++- avrdude/avrpart.c | 13 +++++++++++++ avrdude/avrpart.h | 1 + avrdude/doc/TODO | 3 --- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 2aedc8ee..00219cd6 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,8 @@ +2004-01-12 Jan-Hinnerk Reichert + + * avr910.c, avrpart.c, avrpart.h, doc/TODO: + Look up devicecode and report device. + 2004-01-03 Jan-Hinnerk Reichert * avr910.c, pgm.c, pgm.h, config_gram.y, lexer.l: Add new configuration diff --git a/avrdude/avr910.c b/avrdude/avr910.c index 4ec05483..4d384d8f 100644 --- a/avrdude/avr910.c +++ b/avrdude/avr910.c @@ -174,6 +174,7 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) char type; unsigned char c; int dev_supported = 0; + AVRPART * part; /* Get the programmer identifier. Programmer returns exactly 7 chars _without_ the null.*/ @@ -214,7 +215,9 @@ static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p) avr910_recv(pgm, &c, 1); if (c == 0) break; - fprintf(stderr, " Device code: 0x%02x\n", c); + part = locate_part_by_avr910_devcode(part_list, c); + + fprintf(stderr, " Device code: 0x%02x = %s\n", c, part ? part->desc : "(unknown)"); /* FIXME: Need to lookup devcode and report the device. */ diff --git a/avrdude/avrpart.c b/avrdude/avrpart.c index ea761000..1123ae4d 100644 --- a/avrdude/avrpart.c +++ b/avrdude/avrpart.c @@ -418,6 +418,19 @@ AVRPART * locate_part(LISTID parts, char * partdesc) return NULL; } +AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode) +{ + LNODEID ln1; + AVRPART * p = NULL; + + for (ln1=lfirst(parts); ln1; ln1=lnext(ln1)) { + p = ldata(ln1); + if (p->avr910_devcode == devcode) + return p; + } + + return NULL; +} void list_parts(FILE * f, char * prefix, LISTID parts) { diff --git a/avrdude/avrpart.h b/avrdude/avrpart.h index 96f755d7..db640588 100644 --- a/avrdude/avrpart.h +++ b/avrdude/avrpart.h @@ -135,6 +135,7 @@ void avr_mem_display(char * prefix, FILE * f, AVRMEM * m, int type, AVRPART * avr_new_part(void); AVRPART * avr_dup_part(AVRPART * d); AVRPART * locate_part(LISTID parts, char * partdesc); +AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode); void list_parts(FILE * f, char * prefix, LISTID parts); void avr_display(FILE * f, AVRPART * p, char * prefix, int verbose); diff --git a/avrdude/doc/TODO b/avrdude/doc/TODO index 507c3c27..8c6c4c33 100644 --- a/avrdude/doc/TODO +++ b/avrdude/doc/TODO @@ -15,9 +15,6 @@ - FIXME: term.c: terminal_get_input(): strip newlines in non-readline input code. -- FIXME: avr910.c: avr910_initialize(): Need to lookup devcode and report the - device. - - FIXME: avr910.c: avr910_cmd(): Insert version check here. - FIXME: ser_posix.c: serial_close(): Should really restore the terminal to