Adds avr_pin_name()

Renames pin_name() from avrpart.c to avr_pin_name() and adds a
(globally visible)declaration in avrpart.h
The function takes an integer argument from the pin-enum in pindefs.h and
converts it to a string. The returned string corresponds to the pin names used
in avrdude.conf.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1095 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
hweisbach 2012-07-20 20:05:30 +00:00
parent 76f5411741
commit 4485f9807b
2 changed files with 11 additions and 4 deletions

View File

@ -574,13 +574,19 @@ static char * reset_disp_str(int r)
} }
static char * pin_name(int pinno) const char * avr_pin_name(int pinno)
{ {
switch (pinno) { switch (pinno) {
case PPI_AVR_VCC : return "VCC";
case PPI_AVR_BUFF : return "BUFF";
case PIN_AVR_RESET : return "RESET"; case PIN_AVR_RESET : return "RESET";
case PIN_AVR_MISO : return "MISO";
case PIN_AVR_MOSI : return "MOSI";
case PIN_AVR_SCK : return "SCK"; case PIN_AVR_SCK : return "SCK";
case PIN_AVR_MOSI : return "MOSI";
case PIN_AVR_MISO : return "MISO";
case PIN_LED_ERR : return "ERRLED";
case PIN_LED_RDY : return "RDYLED";
case PIN_LED_PGM : return "PGMLED";
case PIN_LED_VFY : return "VFYLED";
default : return "<unknown>"; default : return "<unknown>";
} }
} }
@ -616,7 +622,7 @@ void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose)
prefix, p->pagel, prefix, p->pagel,
prefix, p->bs2, prefix, p->bs2,
prefix, reset_disp_str(p->reset_disposition), prefix, reset_disp_str(p->reset_disposition),
prefix, pin_name(p->retry_pulse), prefix, avr_pin_name(p->retry_pulse),
prefix, (p->flags & AVRPART_SERIALOK) ? "yes" : "no", prefix, (p->flags & AVRPART_SERIALOK) ? "yes" : "no",
prefix, (p->flags & AVRPART_PARALLELOK) ? prefix, (p->flags & AVRPART_PARALLELOK) ?
((p->flags & AVRPART_PSEUDOPARALLEL) ? "psuedo" : "yes") : "no", ((p->flags & AVRPART_PSEUDOPARALLEL) ? "psuedo" : "yes") : "no",

View File

@ -221,6 +221,7 @@ void avr_free_part(AVRPART * d);
AVRPART * locate_part(LISTID parts, char * partdesc); AVRPART * locate_part(LISTID parts, char * partdesc);
AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode); AVRPART * locate_part_by_avr910_devcode(LISTID parts, int devcode);
void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose); void avr_display(FILE * f, AVRPART * p, const char * prefix, int verbose);
const char * avr_pin_name(int);
typedef void (*walk_avrparts_cb)(const char *name, const char *desc, typedef void (*walk_avrparts_cb)(const char *name, const char *desc,
const char *cfgname, int cfglineno, const char *cfgname, int cfglineno,