Make verbose global. Make debug code in par_cmd() based on verbose=2.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@211 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Eric Weddington 2003-02-20 19:59:11 +00:00
parent d2be0bb300
commit 38a4dcc703
2 changed files with 14 additions and 10 deletions

2
main.c
View File

@ -91,6 +91,7 @@
char * version = "3.1.0"; char * version = "3.1.0";
int verbose; /* verbose output */
char * progname; char * progname;
char progbuf[PATH_MAX]; /* temporary buffer of spaces the same char progbuf[PATH_MAX]; /* temporary buffer of spaces the same
length as progname; used for lining up 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 ppisetbits; /* bits to set in ppi data register at exit */
int ppiclrbits; /* bits to clear 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 */ char * exitspecs; /* exit specs string from command line */
int verbose; /* verbose output */
char * pinconfig; /* programmer id */ char * pinconfig; /* programmer id */
char * partdesc; /* part id */ char * partdesc; /* part id */
char configfile[PATH_MAX]; /* pin configuration file */ char configfile[PATH_MAX]; /* pin configuration file */

14
par.c
View File

@ -74,6 +74,7 @@ static struct ppipins_t pins[] = {
extern char * progname; extern char * progname;
extern int do_cycles; extern int do_cycles;
extern int verbose;
static int par_setpin (int fd, int pin, int value); 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]); res[i] = par_txrx(pgm, cmd[i]);
} }
#if 0 if(verbose >= 2)
fprintf(stderr, "avr_cmd(): [ "); {
fprintf(stderr, "par_cmd(): [ ");
for(i = 0; i < 4; i++) for(i = 0; i < 4; i++)
fprintf(stderr, "%02x ", cmd[i]); fprintf(stderr, "%02X ", cmd[i]);
fprintf(stderr, "] [ "); fprintf(stderr, "] [ ");
for(i = 0; i < 4; i++) for(i = 0; i < 4; i++)
fprintf(stderr, "%02x ", res[i]); {
fprintf(stderr, "%02X ", res[i]);
}
fprintf(stderr, "]\n"); fprintf(stderr, "]\n");
#endif }
return 0; return 0;
} }