From 4339967b19dae036f8f4aa76748caeeed848edf6 Mon Sep 17 00:00:00 2001 From: bsd Date: Thu, 12 Dec 2002 03:59:28 +0000 Subject: [PATCH] minor cleanup git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@168 81a1dc3b-b13d-400b-aceb-764788c761c2 --- main.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 68d0c333..201d983c 100644 --- a/main.c +++ b/main.c @@ -433,7 +433,7 @@ int main(int argc, char * argv []) char configfile[PATH_MAX]; /* pin configuration file */ int cycles; /* erase-rewrite cycles */ int set_cycles; /* value to set the erase-rewrite cycles to */ - char * e; + char * e; /* for strtol() error checking */ progname = rindex(argv[0],'/'); if (progname) @@ -690,7 +690,7 @@ int main(int argc, char * argv []) pgm = locate_pinconfig(programmers, pinconfig); if (pgm == NULL) { fprintf(stderr, - "%s: Can't find pin config id \"%s\"\n", + "%s: Can't find programmer id \"%s\"\n", progname, pinconfig); fprintf(stderr,"\n"); exit(1); @@ -703,7 +703,9 @@ int main(int argc, char * argv []) " Valid Parts are:\n\n", progname); list_parts(stderr, " ", part_list); - fprintf(stderr,"\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "(These come from the config file \"%s\")\n", configfile); + fprintf(stderr, "\n"); exit(1); } @@ -715,6 +717,8 @@ int main(int argc, char * argv []) progname, partdesc); list_parts(stderr, " ", part_list); fprintf(stderr, "\n"); + fprintf(stderr, "(These come from the config file \"%s\")\n", configfile); + fprintf(stderr, "\n"); exit(1); } @@ -764,6 +768,9 @@ int main(int argc, char * argv []) exitrc = 0; + /* + * allow the programmer to save its state + */ rc = pgm->save(pgm); if (rc < 0) { exitrc = 1; @@ -776,7 +783,6 @@ int main(int argc, char * argv []) pgm->ppidata |= ppisetbits; } - /* * enable the programmer */ @@ -1040,6 +1046,9 @@ int main(int argc, char * argv []) pgm->powerdown(pgm); + /* + * restore programmer state + */ pgm->restore(pgm); pgm->disable(pgm);