mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
Submitted by Neil Davey:
patch #4539: Ability to control the bit clock (usleep) delay for ppi interface * bitbang.c: Implement bitbang_delay() and its calibration. * bitbang.h: Declare bitbang_delay(). * main.c: Add the ispdelay option (-i). * pgm.h (struct programmer_t): Add the ispdelay parameter. * par.c: Add calls to bitbang_delay() when requested. * serbb_posix.c: (Ditto.) * serbb_win32.c: (Ditto.) * avrdude.1: Document the new -i option. * doc/avrdude.texi: (Ditto.) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@610 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
21
main.c
21
main.c
@@ -105,6 +105,7 @@ void usage(void)
|
||||
" -C <config-file> Specify location of configuration file.\n"
|
||||
" -c <programmer> Specify programmer type.\n"
|
||||
" -D Disable auto erase for flash memory\n"
|
||||
" -i <delay> ISP Clock Delay [in microseconds]\n"
|
||||
" -P <port> Specify connection port.\n"
|
||||
" -F Override invalid signature check.\n"
|
||||
" -e Perform a chip erase.\n"
|
||||
@@ -695,6 +696,7 @@ int main(int argc, char * argv [])
|
||||
char * e; /* for strtol() error checking */
|
||||
int baudrate; /* override default programmer baud rate */
|
||||
double bitclock; /* Specify programmer bit clock (JTAG ICE) */
|
||||
int ispdelay; /* Specify the delay for ISP clock */
|
||||
int safemode; /* Enable safemode, 1=safemode on, 0=normal */
|
||||
int silentsafe; /* Don't ask about fuses, 1=silent, 0=normal */
|
||||
unsigned char safemode_lfuse = 0xff;
|
||||
@@ -752,6 +754,7 @@ int main(int argc, char * argv [])
|
||||
set_cycles = -1;
|
||||
baudrate = 0;
|
||||
bitclock = 0.0;
|
||||
ispdelay = 0;
|
||||
safemode = 1; /* Safemode on by default */
|
||||
silentsafe = 0; /* Ask by default */
|
||||
|
||||
@@ -802,7 +805,7 @@ int main(int argc, char * argv [])
|
||||
/*
|
||||
* process command line arguments
|
||||
*/
|
||||
while ((ch = getopt(argc,argv,"?b:B:c:C:DeE:Fnp:P:qstU:uvVyY:")) != -1) {
|
||||
while ((ch = getopt(argc,argv,"?b:B:c:C:DeE:Fi:np:P:qstU:uvVyY:")) != -1) {
|
||||
|
||||
switch (ch) {
|
||||
case 'b': /* override default programmer baud rate */
|
||||
@@ -823,6 +826,15 @@ int main(int argc, char * argv [])
|
||||
}
|
||||
break;
|
||||
|
||||
case 'i': /* specify isp clock delay */
|
||||
ispdelay = strtol(optarg, &e,10);
|
||||
if ((e == optarg) || (*e != 0) || ispdelay == 0) {
|
||||
fprintf(stderr, "%s: invalid isp clock delay specified '%s'\n",
|
||||
progname, optarg);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'c': /* programmer id */
|
||||
programmer = optarg;
|
||||
break;
|
||||
@@ -1133,6 +1145,13 @@ int main(int argc, char * argv [])
|
||||
pgm->bitclock = bitclock * 1e-6;
|
||||
}
|
||||
|
||||
if (ispdelay != 0) {
|
||||
if (verbose) {
|
||||
fprintf(stderr, "%sSetting isp clock delay: %3i\n", progbuf, ispdelay);
|
||||
}
|
||||
pgm->ispdelay = ispdelay;
|
||||
}
|
||||
|
||||
rc = pgm->open(pgm, port);
|
||||
if (rc < 0) {
|
||||
exitrc = 1;
|
||||
|
Reference in New Issue
Block a user