mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 17:34:56 +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:
31
par.c
31
par.c
@@ -48,8 +48,6 @@ extern int verbose;
|
||||
|
||||
#if HAVE_PARPORT
|
||||
|
||||
#define SLOW_TOGGLE 0
|
||||
|
||||
struct ppipins_t {
|
||||
int pin;
|
||||
int reg;
|
||||
@@ -102,9 +100,8 @@ static int par_setpin(PROGRAMMER * pgm, int pin, int value)
|
||||
else
|
||||
ppi_clr(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
|
||||
#if SLOW_TOGGLE
|
||||
usleep(1000);
|
||||
#endif
|
||||
if (pgm->ispdelay > 1)
|
||||
bitbang_delay(pgm->ispdelay);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -155,24 +152,20 @@ static int par_highpulsepin(PROGRAMMER * pgm, int pin)
|
||||
|
||||
if (inverted) {
|
||||
ppi_clr(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
#if SLOW_TOGGLE
|
||||
usleep(1000);
|
||||
#endif
|
||||
ppi_set(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
if (pgm->ispdelay > 1)
|
||||
bitbang_delay(pgm->ispdelay);
|
||||
|
||||
#if SLOW_TOGGLE
|
||||
usleep(1000);
|
||||
#endif
|
||||
ppi_set(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
if (pgm->ispdelay > 1)
|
||||
bitbang_delay(pgm->ispdelay);
|
||||
} else {
|
||||
ppi_set(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
#if SLOW_TOGGLE
|
||||
usleep(1000);
|
||||
#endif
|
||||
ppi_clr(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
if (pgm->ispdelay > 1)
|
||||
bitbang_delay(pgm->ispdelay);
|
||||
|
||||
#if SLOW_TOGGLE
|
||||
usleep(1000);
|
||||
#endif
|
||||
ppi_clr(pgm->fd, ppipins[pin].reg, ppipins[pin].bit);
|
||||
if (pgm->ispdelay > 1)
|
||||
bitbang_delay(pgm->ispdelay);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user