mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-10-09 04:01:01 +00:00
bug #30559 Ft232 bit-bang support
* ft245r.[ch]: new programmer type implementation * configure.ac: add pthread as link library * avrdude.conf.in: added some new programmers * Makefile.am: added new source files to compile * pindefs.h: change PIN_MASK, PIN_INVERSE to highest bit of unsigned int * pgm.[ch]: added generic function to print pin assignments (taken from par.c) * par.c: moved pin assigment print function to pgm.c git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1055 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
66
pgm.c
66
pgm.c
@@ -212,6 +212,72 @@ void programmer_display(PROGRAMMER * pgm, const char * p)
|
||||
pgm->display(pgm, p);
|
||||
}
|
||||
|
||||
static char * pins_to_str(unsigned int pmask)
|
||||
{
|
||||
static char buf[64];
|
||||
int pin;
|
||||
char b2[8];
|
||||
|
||||
if ((pmask & PIN_MASK) == 0)
|
||||
return " (not used)";
|
||||
|
||||
buf[0] = ' ';
|
||||
buf[1] = 0;
|
||||
for (pin = 0; pin <= 17; pin++) {
|
||||
if (pmask & (1 << pin)) {
|
||||
sprintf(b2, "%d", pin);
|
||||
if (buf[1] != 0)
|
||||
strcat(buf, ",");
|
||||
strcat(buf, b2);
|
||||
}
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static char * pin_to_str(unsigned int pin)
|
||||
{
|
||||
static char buf[12];
|
||||
|
||||
if ((pin & PIN_MASK) == 0)
|
||||
return " (not used)";
|
||||
|
||||
buf[0] = (pin & PIN_INVERSE)?'~':' ';
|
||||
buf[1] = 0;
|
||||
sprintf(buf+1, "%d", pin & PIN_MASK);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
void pgm_display_generic_mask(PROGRAMMER * pgm, const char * p, unsigned int show)
|
||||
{
|
||||
if(show & (1<<PPI_AVR_VCC))
|
||||
fprintf(stderr, "%s VCC = %s\n", p, pins_to_str(pgm->pinno[PPI_AVR_VCC]));
|
||||
if(show & (1<<PPI_AVR_BUFF))
|
||||
fprintf(stderr, "%s BUFF = %s\n", p, pins_to_str(pgm->pinno[PPI_AVR_BUFF]));
|
||||
if(show & (1<<PIN_AVR_RESET))
|
||||
fprintf(stderr, "%s RESET = %s\n", p, pin_to_str(pgm->pinno[PIN_AVR_RESET]));
|
||||
if(show & (1<<PIN_AVR_SCK))
|
||||
fprintf(stderr, "%s SCK = %s\n", p, pin_to_str(pgm->pinno[PIN_AVR_SCK]));
|
||||
if(show & (1<<PIN_AVR_MOSI))
|
||||
fprintf(stderr, "%s MOSI = %s\n", p, pin_to_str(pgm->pinno[PIN_AVR_MOSI]));
|
||||
if(show & (1<<PIN_AVR_MISO))
|
||||
fprintf(stderr, "%s MISO = %s\n", p, pin_to_str(pgm->pinno[PIN_AVR_MISO]));
|
||||
if(show & (1<<PIN_LED_ERR))
|
||||
fprintf(stderr, "%s ERR LED = %s\n", p, pin_to_str(pgm->pinno[PIN_LED_ERR]));
|
||||
if(show & (1<<PIN_LED_RDY))
|
||||
fprintf(stderr, "%s RDY LED = %s\n", p, pin_to_str(pgm->pinno[PIN_LED_RDY]));
|
||||
if(show & (1<<PIN_LED_PGM))
|
||||
fprintf(stderr, "%s PGM LED = %s\n", p, pin_to_str(pgm->pinno[PIN_LED_PGM]));
|
||||
if(show & (1<<PIN_LED_VFY))
|
||||
fprintf(stderr, "%s VFY LED = %s\n", p, pin_to_str(pgm->pinno[PIN_LED_VFY]));
|
||||
}
|
||||
|
||||
void pgm_display_generic(PROGRAMMER * pgm, const char * p)
|
||||
{
|
||||
pgm_display_generic_mask(pgm, p, SHOW_ALL_PINS);
|
||||
}
|
||||
|
||||
PROGRAMMER * locate_programmer(LISTID programmers, const char * configid)
|
||||
{
|
||||
LNODEID ln1, ln2;
|
||||
|
Reference in New Issue
Block a user