diff --git a/src/avrdude.1 b/src/avrdude.1 index 25c42263..660f21c8 100644 --- a/src/avrdude.1 +++ b/src/avrdude.1 @@ -1253,7 +1253,7 @@ frame is programmed. .It Ar delay= Add a ms delay after reset. This can be useful if a board takes a particularly long time to exit from external reset. can be negative, -in which case the default 110 ms delay after issuing reset will be +in which case the default 110-140 ms delay after issuing reset will be shortened accordingly. .It Ar strict Urclock has a faster, but slightly different strategy than -c arduino to diff --git a/src/doc/avrdude.texi b/src/doc/avrdude.texi index a086c2ae..71e1e272 100644 --- a/src/doc/avrdude.texi +++ b/src/doc/avrdude.texi @@ -1049,7 +1049,7 @@ frame is programmed. @item @samp{delay=} Add a ms delay after reset. This can be useful if a board takes a particularly long time to exit from external reset. can be negative, -in which case the default 110 ms delay after issuing reset will be +in which case the default 110-140 ms delay after issuing reset will be shortened accordingly. @item @samp{strict} Urclock has a faster, but slightly different strategy than -c arduino to diff --git a/src/urclock.c b/src/urclock.c index f4b90214..45f9d9e7 100644 --- a/src/urclock.c +++ b/src/urclock.c @@ -1872,7 +1872,7 @@ static int urclock_recv(const PROGRAMMER *pgm, unsigned char *buf, size_t len) { rv = serial_recv(&pgm->fd, buf, len); if(rv < 0) { if(!ur.sync_silence) - pmsg_error("programmer is not responding; try and vary -xdelay=100 and/or -xstrict\n"); + pmsg_error("programmer is not responding; try -xstrict and/or vary -xdelay=100\n"); return -1; } @@ -2191,8 +2191,13 @@ static int urclock_open(PROGRAMMER *pgm, const char *port) { // Set DTR and RTS back to high serial_set_dtr_rts(&pgm->fd, 1); +#ifndef WIN32 if((110+ur.delay) > 0) usleep((110+ur.delay)*1000); // Wait until board comes out of reset +#else + if((137+ur.delay) > 0) + usleep((137+ur.delay)*1000); // Wait until board starts up accommodating effective drain time +#endif // Drain any extraneous input serial_drain_timeout = 20; // ms