Rework the exit specs so they actually work again. It should be

possible to extend them for other programmers than PPI now (serbb,
stk500*).

* pgm.h: Keep the exit specs in an abstract form inside struct
programmer_t.  (Should be moved out into some programmer-specific
structure.)  Rename the getexitspecs() method into
parseexitspecs().
* main.c: Move the exit specs stuff out to the programmer
implementation.
* par.c: Implement the new exit spec handling.  Everything is now
done using the generic abstraction layer.

Closes bug #16443: No disable Resetsignal at the end of
Programming Session

Obviates need for patch #5057: quick and dirty Hack to unset Reset
after Programming


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@629 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2006-08-29 23:12:15 +00:00
parent 3917cbe3a4
commit 49de0c7e9a
4 changed files with 78 additions and 37 deletions

16
main.c
View File

@@ -673,8 +673,6 @@ int main(int argc, char * argv [])
int terminal; /* 1=enter terminal mode, 0=don't */
int nowrite; /* don't actually write anything to the chip */
int verify; /* perform a verify operation */
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 */
char * programmer; /* programmer id */
char * partdesc; /* part id */
@@ -733,8 +731,6 @@ int main(int argc, char * argv [])
nowrite = 0;
verify = 1; /* on by default */
quell_progress = 0;
ppisetbits = 0;
ppiclrbits = 0;
exitspecs = NULL;
pgm = NULL;
programmer = default_programmer;
@@ -1074,13 +1070,13 @@ int main(int argc, char * argv [])
if (exitspecs != NULL) {
if (pgm->getexitspecs == NULL) {
if (pgm->parseexitspecs == NULL) {
fprintf(stderr,
"%s: WARNING: -E option not supported by this programmer type\n",
progname);
exitspecs = NULL;
}
else if (pgm->getexitspecs(pgm, exitspecs, &ppisetbits, &ppiclrbits) < 0) {
else if (pgm->parseexitspecs(pgm, exitspecs) < 0) {
usage();
exit(1);
}
@@ -1152,14 +1148,6 @@ int main(int argc, char * argv [])
exitrc = 0;
/*
* handle exit specs. FIXME: this should be moved to "par.c"
*/
if (strcmp(pgm->type, "PPI") == 0) {
pgm->ppidata &= ~ppiclrbits;
pgm->ppidata |= ppisetbits;
}
/*
* enable the programmer
*/