mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
main.c, pgm.c, pgm.h: Add the -x option to pass extended parameters to
the programmer backend. jtagmkII.c: Implement the extended parameter jtagchain= to support JTAG daisy-chains. avrdude.1, doc/avrdude.texi: Document all of the above. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@761 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
33
main.c
33
main.c
@@ -72,6 +72,8 @@ struct list_walk_cookie
|
||||
|
||||
static LISTID updates;
|
||||
|
||||
static LISTID extended_params;
|
||||
|
||||
/*
|
||||
* global options
|
||||
*/
|
||||
@@ -111,6 +113,7 @@ static void usage(void)
|
||||
" fuses should be changed back.\n"
|
||||
" -t Enter terminal mode.\n"
|
||||
" -E <exitspec>[,<exitspec>] List programmer exit specifications.\n"
|
||||
" -x <extended_param> Pass <extended_param> to programmer.\n"
|
||||
" -y Count # erase cycles in EEPROM.\n"
|
||||
" -Y <number> Initialize erase cycle # in EEPROM.\n"
|
||||
" -v Verbose output. -v -v for more.\n"
|
||||
@@ -302,6 +305,12 @@ int main(int argc, char * argv [])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
extended_params = lcreat(NULL, 0);
|
||||
if (extended_params == NULL) {
|
||||
fprintf(stderr, "%s: cannot initialize extended parameter list\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
partdesc = NULL;
|
||||
port = default_parallel;
|
||||
erase = 0;
|
||||
@@ -324,7 +333,7 @@ int main(int argc, char * argv [])
|
||||
ispdelay = 0;
|
||||
safemode = 1; /* Safemode on by default */
|
||||
silentsafe = 0; /* Ask by default */
|
||||
|
||||
|
||||
if (isatty(STDIN_FILENO) == 0)
|
||||
safemode = 0; /* Turn off safemode if this isn't a terminal */
|
||||
|
||||
@@ -372,7 +381,7 @@ int main(int argc, char * argv [])
|
||||
/*
|
||||
* process command line arguments
|
||||
*/
|
||||
while ((ch = getopt(argc,argv,"?b:B:c:C:DeE:Fi:np:OP:qstU:uvVyY:")) != -1) {
|
||||
while ((ch = getopt(argc,argv,"?b:B:c:C:DeE:Fi:np:OP:qstU:uvVx:yY:")) != -1) {
|
||||
|
||||
switch (ch) {
|
||||
case 'b': /* override default programmer baud rate */
|
||||
@@ -484,6 +493,10 @@ int main(int argc, char * argv [])
|
||||
verify = 0;
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
ladd(extended_params, optarg);
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
do_cycles = 1;
|
||||
break;
|
||||
@@ -623,6 +636,22 @@ int main(int argc, char * argv [])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (lsize(extended_params) > 0) {
|
||||
if (pgm->parseextparams == NULL) {
|
||||
fprintf(stderr,
|
||||
"%s: WARNING: Programmer doesn't support extended parameters,"
|
||||
" -x option(s) ignored\n",
|
||||
progname);
|
||||
} else {
|
||||
if (pgm->parseextparams(pgm, extended_params) < 0) {
|
||||
fprintf(stderr,
|
||||
"%s: Error parsing extended parameter list\n",
|
||||
progname);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((strcmp(pgm->type, "STK500") == 0) ||
|
||||
(strcmp(pgm->type, "avr910") == 0) ||
|
||||
(strcmp(pgm->type, "STK500V2") == 0) ||
|
||||
|
Reference in New Issue
Block a user