* main.c: Removed deprecated options.
* doc/TODO: Still need to remove these options from documentation git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@410 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
11b56cf88b
commit
34c5ee9f0d
|
@ -1,3 +1,7 @@
|
|||
2004-02-10 Jan-Hinnerk Reichert <hinni@despammed.com>
|
||||
|
||||
* main.c: Removed deprecated options.
|
||||
|
||||
2004-01-28 Jan-Hinnerk Reichert <hinni@despammed.com>
|
||||
|
||||
* pgm.c, main.c, avr910.c, butterfly.c, stk500.c:
|
||||
|
|
2
doc/TODO
2
doc/TODO
|
@ -4,6 +4,8 @@
|
|||
- Website needs to link to docs:
|
||||
http://savannah.nongnu.org/download/avrdude/doc/avrdude-html/
|
||||
|
||||
- Remove old options from manpage and texinfo-documentation
|
||||
|
||||
- [Windows Port] Use Windows API for serial port communications (ser_win32.c).
|
||||
(In Progress)
|
||||
|
||||
|
|
149
main.c
149
main.c
|
@ -104,12 +104,8 @@ void usage(void)
|
|||
" -P <port> Specify connection port.\n"
|
||||
" -F Override invalid signature check.\n"
|
||||
" -e Perform a chip erase.\n"
|
||||
" -m <memtype> (deprecated) Memory type to operate on.\n"
|
||||
" -i <filename> (deprecated) Write device. Specify an input file.\n"
|
||||
" -o <filename> (deprecated) Read device. Specify an output file.\n"
|
||||
" -f <format> (deprecated) Specify the file format.\n"
|
||||
" -U <memtype>:r|w|v:<filename>[:format]\n"
|
||||
" Alternate memory operation specification.\n"
|
||||
" Memory operation specification.\n"
|
||||
" Multiple -U options are allowed, each request\n"
|
||||
" is performed in the order specified.\n"
|
||||
" -n Do not write anything to the device.\n"
|
||||
|
@ -678,26 +674,18 @@ int main(int argc, char * argv [])
|
|||
int len; /* length for various strings */
|
||||
struct avrpart * p; /* which avr part we are programming */
|
||||
struct avrpart * v; /* used for verify */
|
||||
int readorwrite; /* true if a chip read/write op was selected */
|
||||
AVRMEM * sig; /* signature data */
|
||||
struct stat sb;
|
||||
UPDATE * upd;
|
||||
LNODEID * ln;
|
||||
int deprecated = 0;
|
||||
|
||||
/* options / operating mode variables */
|
||||
char * memtype; /* "flash", "eeprom", etc */
|
||||
int doread; /* 1=reading AVR */
|
||||
int dowrite; /* 1=writing AVR */
|
||||
int erase; /* 1=erase chip, 0=don't */
|
||||
int auto_erase; /* 0=never erase unless explicity told to do
|
||||
so, 1=erase if we are going to program flash */
|
||||
char * outputf; /* output file name */
|
||||
char * inputf; /* input file name */
|
||||
int ovsigck; /* 1=override sig check, 0=don't */
|
||||
char * port; /* device port (/dev/xxx) */
|
||||
int terminal; /* 1=enter terminal mode, 0=don't */
|
||||
FILEFMT filefmt; /* FMT_AUTO, FMT_IHEX, FMT_SREC, FMT_RBIN */
|
||||
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 */
|
||||
|
@ -733,19 +721,12 @@ int main(int argc, char * argv [])
|
|||
}
|
||||
|
||||
partdesc = NULL;
|
||||
readorwrite = 0;
|
||||
port = default_parallel;
|
||||
outputf = NULL;
|
||||
inputf = NULL;
|
||||
doread = 0;
|
||||
dowrite = 0;
|
||||
memtype = "flash";
|
||||
erase = 0;
|
||||
auto_erase = 1;
|
||||
p = NULL;
|
||||
ovsigck = 0;
|
||||
terminal = 0;
|
||||
filefmt = FMT_AUTO;
|
||||
nowrite = 0;
|
||||
verify = 1; /* on by default */
|
||||
quell_progress = 0;
|
||||
|
@ -801,7 +782,7 @@ int main(int argc, char * argv [])
|
|||
/*
|
||||
* process command line arguments
|
||||
*/
|
||||
while ((ch = getopt(argc,argv,"?c:C:DeE:f:Fi:I:m:no:p:P:qtU:vVyY:")) != -1) {
|
||||
while ((ch = getopt(argc,argv,"?c:C:DeE:Fnp:P:qtU:vVyY:")) != -1) {
|
||||
|
||||
switch (ch) {
|
||||
case 'c': /* programmer id */
|
||||
|
@ -819,95 +800,20 @@ int main(int argc, char * argv [])
|
|||
|
||||
case 'e': /* perform a chip erase */
|
||||
erase = 1;
|
||||
auto_erase = 0;
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
exitspecs = optarg;
|
||||
break;
|
||||
|
||||
case 'f': /* specify file format */
|
||||
deprecated = 1;
|
||||
if (strlen(optarg) != 1) {
|
||||
fprintf(stderr, "%s: invalid file format \"%s\"\n",
|
||||
progname, optarg);
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
switch (optarg[0]) {
|
||||
case 'a' : filefmt = FMT_AUTO; break;
|
||||
case 'i' : filefmt = FMT_IHEX; break;
|
||||
case 'r' : filefmt = FMT_RBIN; break;
|
||||
case 's' : filefmt = FMT_SREC; break;
|
||||
case 'm' : filefmt = FMT_IMM; break;
|
||||
break;
|
||||
default :
|
||||
fprintf(stderr, "%s: invalid file format \"%s\"\n\n",
|
||||
progname, optarg);
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'F': /* override invalid signature check */
|
||||
ovsigck = 1;
|
||||
break;
|
||||
|
||||
case 'i': /* specify input file */
|
||||
deprecated = 1;
|
||||
auto_erase = 0;
|
||||
if (outputf || terminal) {
|
||||
fprintf(stderr,"%s: -o, -i, and -t are incompatible\n\n", progname);
|
||||
return 1;
|
||||
}
|
||||
dowrite = 1;
|
||||
inputf = optarg;
|
||||
break;
|
||||
|
||||
case 'I': /* specify input file and assume 'immediate mode' */
|
||||
deprecated = 1;
|
||||
auto_erase = 0;
|
||||
if (outputf || terminal) {
|
||||
fprintf(stderr,"%s: -o, -I, and -t are incompatible\n\n", progname);
|
||||
return 1;
|
||||
}
|
||||
dowrite = 1;
|
||||
inputf = optarg;
|
||||
filefmt = FMT_IMM;
|
||||
break;
|
||||
|
||||
case 'm': /* select memory type to operate on */
|
||||
deprecated = 1;
|
||||
if ((strcasecmp(optarg,"e")==0)||(strcasecmp(optarg,"eeprom")==0)) {
|
||||
memtype = "eeprom";
|
||||
}
|
||||
else if ((strcasecmp(optarg,"f")==0)||
|
||||
(strcasecmp(optarg,"flash")==0)) {
|
||||
memtype = "flash";
|
||||
}
|
||||
else {
|
||||
memtype = optarg;
|
||||
}
|
||||
readorwrite = 1;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
nowrite = 1;
|
||||
break;
|
||||
|
||||
case 'o': /* specify output file */
|
||||
deprecated = 1;
|
||||
auto_erase = 0;
|
||||
if (inputf || terminal) {
|
||||
fprintf(stderr,"%s: -i, -o, and -t are incompatible\n\n", progname);
|
||||
return 1;
|
||||
}
|
||||
doread = 1;
|
||||
outputf = optarg;
|
||||
if (filefmt == FMT_AUTO)
|
||||
filefmt = FMT_RBIN;
|
||||
break;
|
||||
|
||||
case 'p' : /* specify AVR part */
|
||||
partdesc = optarg;
|
||||
break;
|
||||
|
@ -921,13 +827,6 @@ int main(int argc, char * argv [])
|
|||
break;
|
||||
|
||||
case 't': /* enter terminal mode */
|
||||
if (!((inputf == NULL)||(outputf == NULL))) {
|
||||
fprintf(stderr,
|
||||
"%s: terminal mode is not compatible with -i or -o\n\n",
|
||||
progname);
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
terminal = 1;
|
||||
break;
|
||||
|
||||
|
@ -983,13 +882,6 @@ int main(int argc, char * argv [])
|
|||
|
||||
}
|
||||
|
||||
if (deprecated) {
|
||||
fprintf(stderr,
|
||||
"\n%s: WARNING: the -f, -i, -I, -o, and -m options are deprecated.\n"
|
||||
"%sPlease use the -U option instead.\n",
|
||||
progname, progbuf);
|
||||
}
|
||||
|
||||
|
||||
if (quell_progress == 0) {
|
||||
if (isatty (STDERR_FILENO))
|
||||
|
@ -1348,49 +1240,13 @@ int main(int argc, char * argv [])
|
|||
}
|
||||
|
||||
|
||||
|
||||
if (!terminal && (lsize(updates) == 0) &&
|
||||
((inputf==NULL) && (outputf==NULL))) {
|
||||
/*
|
||||
* Check here to see if any other operations were selected and
|
||||
* generate an error message because if they were, we need either
|
||||
* an input or an output file, but one was not selected.
|
||||
* Otherwise, we just shut down.
|
||||
*/
|
||||
if (readorwrite) {
|
||||
fprintf(stderr, "%s: you must specify an input or an output file\n",
|
||||
progname);
|
||||
exitrc = 1;
|
||||
}
|
||||
goto main_exit;
|
||||
}
|
||||
|
||||
if (doread && dowrite) {
|
||||
fprintf(stderr, "%s: can't be reading and writing from/to the same file\n",
|
||||
progname);
|
||||
exitrc = 1;
|
||||
goto main_exit;
|
||||
}
|
||||
|
||||
if (terminal) {
|
||||
/*
|
||||
* terminal mode
|
||||
*/
|
||||
exitrc = terminal_mode(pgm, p);
|
||||
}
|
||||
else if (doread) {
|
||||
upd = new_update(DEVICE_READ, memtype, filefmt, outputf);
|
||||
ladd(updates, upd);
|
||||
}
|
||||
else if (dowrite) {
|
||||
upd = new_update(DEVICE_WRITE, memtype, filefmt, inputf);
|
||||
ladd(updates, upd);
|
||||
}
|
||||
|
||||
if (!doread && verify && inputf) {
|
||||
upd = new_update(DEVICE_VERIFY, memtype, filefmt, inputf);
|
||||
ladd(updates, upd);
|
||||
}
|
||||
|
||||
for (ln=lfirst(updates); ln; ln=lnext(ln)) {
|
||||
upd = ldata(ln);
|
||||
|
@ -1419,4 +1275,3 @@ int main(int argc, char * argv [])
|
|||
|
||||
return exitrc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue