diff --git a/avrdude/main.c b/avrdude/main.c index 610b6bc8..fb132e7b 100644 --- a/avrdude/main.c +++ b/avrdude/main.c @@ -91,6 +91,7 @@ char * version = "3.1.0"; +int verbose; /* verbose output */ char * progname; char progbuf[PATH_MAX]; /* temporary buffer of spaces the same length as progname; used for lining up @@ -294,7 +295,6 @@ int main(int argc, char * argv []) int ppisetbits; /* bits to set in ppi data register at exit */ int ppiclrbits; /* bits to clear in ppi data register at exit */ char * exitspecs; /* exit specs string from command line */ - int verbose; /* verbose output */ char * pinconfig; /* programmer id */ char * partdesc; /* part id */ char configfile[PATH_MAX]; /* pin configuration file */ diff --git a/avrdude/par.c b/avrdude/par.c index 3dae6196..d02d80b2 100644 --- a/avrdude/par.c +++ b/avrdude/par.c @@ -74,6 +74,7 @@ static struct ppipins_t pins[] = { extern char * progname; extern int do_cycles; +extern int verbose; static int par_setpin (int fd, int pin, int value); @@ -294,15 +295,18 @@ static int par_cmd(PROGRAMMER * pgm, unsigned char cmd[4], res[i] = par_txrx(pgm, cmd[i]); } -#if 0 - fprintf(stderr, "avr_cmd(): [ "); - for (i=0; i<4; i++) - fprintf(stderr, "%02x ", cmd[i]); - fprintf(stderr, "] [ "); - for (i=0; i<4; i++) - fprintf(stderr, "%02x ", res[i]); - fprintf(stderr, "]\n"); -#endif + if(verbose >= 2) + { + fprintf(stderr, "par_cmd(): [ "); + for(i = 0; i < 4; i++) + fprintf(stderr, "%02X ", cmd[i]); + fprintf(stderr, "] [ "); + for(i = 0; i < 4; i++) + { + fprintf(stderr, "%02X ", res[i]); + } + fprintf(stderr, "]\n"); + } return 0; }