Implement and document the "verbose" terminal mode command.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1211 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2013-09-08 19:31:48 +00:00
parent ee861c4492
commit 44069c7b69
5 changed files with 62 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-09-08 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* term.c: Implement the "verbose" terminal mode command.
* avrdude.1: Document this.
* doc/avrdude.texi: (Dito.)
2013-09-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* jtag3.c (jtag3_write_byte): Do not attempt to start the paged

3
NEWS
View File

@ -163,6 +163,9 @@ Current:
* The USBasp programmer implementation now supports detailed traces
with -vvv, and device communication traces with -vvvv.
* The "verbose" terminal mode command allows to query or modify the
verbosity level.
* Internals:
- Restructuring and compacting programmer definition part of

View File

@ -18,7 +18,7 @@
.\"
.\" $Id$
.\"
.Dd DATE September 3, 2013
.Dd DATE September 8, 2013
.Os
.Dt AVRDUDE 1
.Sh NAME
@ -662,6 +662,9 @@ This will only work if
does not have a colon in it.
.It Fl v
Enable verbose output.
More
.Fl v
options increase verbosity level.
.It Fl V
Disable automatic verify check when uploading data.
.It Fl x Ar extended_param
@ -777,6 +780,13 @@ Display the current voltage and master oscillator parameters.
.Pp
.Em JTAG ICE only:
Display the current target supply voltage and JTAG bit clock rate/period.
.It Ar verbose Op Ar level
Change (when
.Ar level
is provided), or display the verbosity level.
The initial verbosity level is controlled by the number of
.Fl v
options given on the commandline.
.It Ar \&?
.It Ar help
Give a short on-line summary of the available commands.

View File

@ -699,6 +699,7 @@ This will only work if @var{filename} does not have a colon in it.
@item -v
Enable verbose output.
More @code{-v} options increase verbosity level.
@item -V
Disable automatic verify check when uploading data.
@ -1116,6 +1117,12 @@ device, read/write timing, etc.
@item pgm
Return to programming mode (from direct SPI mode).
@item verbose [@var{level}]
Change (when @var{level} is provided), or display the verbosity
level.
The initial verbosity level is controlled by the number of @code{-v} options
given on the commandline.
@item ?
@itemx help
Give a short on-line summary of the available commands.

35
term.c
View File

@ -93,6 +93,9 @@ static int cmd_spi (PROGRAMMER * pgm, struct avrpart * p,
static int cmd_pgm (PROGRAMMER * pgm, struct avrpart * p,
int argc, char *argv[]);
static int cmd_verbose (PROGRAMMER * pgm, struct avrpart * p,
int argc, char *argv[]);
struct command cmd[] = {
{ "dump", cmd_dump, "dump memory : %s <memtype> <addr> <N-Bytes>" },
{ "read", cmd_dump, "alias for dump" },
@ -108,6 +111,7 @@ struct command cmd[] = {
{ "sck", cmd_sck, "set <SCK period> (STK500 only)" },
{ "spi", cmd_spi, "enter direct SPI mode" },
{ "pgm", cmd_pgm, "return to programming mode" },
{ "verbose", cmd_verbose, "change verbosity" },
{ "help", cmd_help, "help" },
{ "?", cmd_help, "help" },
{ "quit", cmd_quit, "quit" }
@ -759,6 +763,37 @@ static int cmd_pgm(PROGRAMMER * pgm, struct avrpart * p,
return 0;
}
static int cmd_verbose(PROGRAMMER * pgm, struct avrpart * p,
int argc, char * argv[])
{
int nverb;
char *endp;
if (argc != 1 && argc != 2) {
fprintf(stderr, "Usage: verbose [<value>]\n");
return -1;
}
if (argc == 1) {
fprintf(stderr, "Verbosity level: %d\n", verbose);
return 0;
}
nverb = strtol(argv[1], &endp, 0);
if (endp == argv[2]) {
fprintf(stderr, "%s: can't parse verbosity level \"%s\"\n",
progname, argv[2]);
return -1;
}
if (nverb < 0) {
fprintf(stderr, "%s: verbosity level must be positive: %d\n",
progname, nverb);
return -1;
}
verbose = nverb;
fprintf(stderr, "New verbosity level: %d\n", verbose);
return 0;
}
static int tokenize(char * s, char *** argv)
{
int i, n, l, nargs, offset;