From 5b537c0cdbda61b6a6d72373c425644635accb13 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/avrdude@399 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 5 +++++ avr910.c | 5 ++++- avrpart.c | 13 +++++++++++++ avrpart.h | 1 + doc/TODO | 3 --- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2aedc8ee..00219cd6 100644 --- a/ChangeLog +++ b/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/avr910.c b/avr910.c index 4ec05483..4d384d8f 100644 --- a/avr910.c +++ b/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/avrpart.c b/avrpart.c index ea761000..1123ae4d 100644 --- a/avrpart.c +++ b/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/avrpart.h b/avrpart.h index 96f755d7..db640588 100644 --- a/avrpart.h +++ b/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/doc/TODO b/doc/TODO index 507c3c27..8c6c4c33 100644 --- a/doc/TODO +++ b/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