Submitted by Stefan Tomanek:
patch #7542: add default_bitclock to configuration files git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@988 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
b7c70ab98c
commit
0a1f0ad778
16
ChangeLog
16
ChangeLog
|
@ -1,7 +1,21 @@
|
|||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Stefan Tomanek:
|
||||
patch #7542: add default_bitclock to configuration files
|
||||
* config.c: Add the new keyword and its handling.
|
||||
* config.h: (Ditto.)
|
||||
* config_gram.y: (Ditto.)
|
||||
* avrdude.conf.in: (Ditto.)
|
||||
* main.c: (Ditto.)
|
||||
* lexer.l: (Ditto.)
|
||||
* avrdude.1: Document the change.
|
||||
* doc/avrdude.texi: (Ditto.)
|
||||
|
||||
2011-08-26 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Brett Hagman:
|
||||
Add support for the "Wiring" board/bootloader
|
||||
patch #7603: wiring - programmer type for Wiring boards
|
||||
(based on STK500v2)
|
||||
* wiring.c: New file.
|
||||
* wiring.h: (Ditto.)
|
||||
* Makefile.am: Add new files.
|
||||
|
|
|
@ -330,6 +330,10 @@ Unlike certain parameters in the STK500, the JTAG ICE resets all its
|
|||
parameters to default values when the programming software signs
|
||||
off from the ICE, so for MCUs running at lower clock speeds, this
|
||||
parameter must be specified on the command-line.
|
||||
You can use the 'default_bitclock' keyword in your
|
||||
.Pa ${HOME}/.avrduderc
|
||||
file to assign a default value to keep from having to specify this
|
||||
option on every invocation.
|
||||
.It Fl c Ar programmer-id
|
||||
Use the pin configuration specified by the argument. Pin
|
||||
configurations are read from the config file (see the
|
||||
|
|
|
@ -316,6 +316,7 @@
|
|||
#
|
||||
default_parallel = "@DEFAULT_PAR_PORT@";
|
||||
default_serial = "@DEFAULT_SER_PORT@";
|
||||
# default_bitclock = 2.5
|
||||
|
||||
|
||||
#
|
||||
|
|
1
config.c
1
config.c
|
@ -35,6 +35,7 @@
|
|||
char default_programmer[MAX_STR_CONST];
|
||||
char default_parallel[PATH_MAX];
|
||||
char default_serial[PATH_MAX];
|
||||
double default_bitclock;
|
||||
|
||||
char string_buf[MAX_STR_CONST];
|
||||
char *string_buf_ptr;
|
||||
|
|
1
config.h
1
config.h
|
@ -57,6 +57,7 @@ extern LISTID programmers;
|
|||
extern char default_programmer[];
|
||||
extern char default_parallel[];
|
||||
extern char default_serial[];
|
||||
extern double default_bitclock;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ static int parse_cmdbits(OPCODE * op);
|
|||
%token K_DEFAULT_PARALLEL
|
||||
%token K_DEFAULT_PROGRAMMER
|
||||
%token K_DEFAULT_SERIAL
|
||||
%token K_DEFAULT_BITCLOCK
|
||||
%token K_DESC
|
||||
%token K_DEVICECODE
|
||||
%token K_DRAGON_DW
|
||||
|
@ -273,6 +274,11 @@ def :
|
|||
strncpy(default_serial, $3->value.string, PATH_MAX);
|
||||
default_serial[PATH_MAX-1] = 0;
|
||||
free_token($3);
|
||||
} |
|
||||
|
||||
K_DEFAULT_BITCLOCK TKN_EQUAL TKN_NUMBER TKN_SEMI {
|
||||
default_bitclock = $3->value.number;
|
||||
free_token($3);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
@ -427,6 +427,8 @@ Unlike certain parameters in the STK500, the JTAG ICE resets all its
|
|||
parameters to default values when the programming software signs
|
||||
off from the ICE, so for MCUs running at lower clock speeds, this
|
||||
parameter must be specified on the command-line.
|
||||
It can also be set in the configuration file by using the 'default_bitclock'
|
||||
keyword.
|
||||
|
||||
@item -c @var{programmer-id}
|
||||
Specify the programmer to be used. AVRDUDE knows about several common
|
||||
|
@ -1485,6 +1487,10 @@ Assign the default serial port device. Can be overridden using the
|
|||
Assign the default programmer id. Can be overridden using the @option{-c}
|
||||
option.
|
||||
|
||||
@item default_bitclock = "@var{default-bitclock}";
|
||||
Assign the default bitclock value. Can be overridden using the @option{-B}
|
||||
option.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
|
|
1
lexer.l
1
lexer.l
|
@ -135,6 +135,7 @@ desc { yylval=NULL; return K_DESC; }
|
|||
default_parallel { yylval=NULL; return K_DEFAULT_PARALLEL; }
|
||||
default_programmer { yylval=NULL; return K_DEFAULT_PROGRAMMER; }
|
||||
default_serial { yylval=NULL; return K_DEFAULT_SERIAL; }
|
||||
default_bitclock { yylval=NULL; return K_DEFAULT_BITCLOCK; }
|
||||
devicecode { yylval=NULL; return K_DEVICECODE; }
|
||||
dragon_dw { yylval=NULL; return K_DRAGON_DW; }
|
||||
dragon_hvsp { yylval=NULL; return K_DRAGON_HVSP; }
|
||||
|
|
5
main.c
5
main.c
|
@ -314,6 +314,7 @@ int main(int argc, char * argv [])
|
|||
|
||||
default_parallel[0] = 0;
|
||||
default_serial[0] = 0;
|
||||
default_bitclock = 0.0;
|
||||
|
||||
init_config();
|
||||
|
||||
|
@ -607,6 +608,10 @@ int main(int argc, char * argv [])
|
|||
}
|
||||
}
|
||||
}
|
||||
// set bitclock from configuration files unless changed by command line
|
||||
if (default_bitclock > 0 && bitclock == 0.0) {
|
||||
bitclock = default_bitclock;
|
||||
}
|
||||
|
||||
if (verbose) {
|
||||
fprintf(stderr, "\n");
|
||||
|
|
Loading…
Reference in New Issue