Contributed by <avrdude@zevv.nl> as

patch #4372: Better synchronization for stk500

Sync three times, and drop any noise inbetween.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@641 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2006-09-01 21:00:36 +00:00
parent 859f22e83d
commit 013ba1f836
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-09-01 Joerg Wunsch <j@uriah.heep.sax.de>
Contributed by <avrdude@zevv.nl> as
patch #4372: Better synchronization for stk500
* stk500.c: Sync three times, and drop any noise inbetween.
2006-09-01 Joerg Wunsch <j@uriah.heep.sax.de>
* avrdude.conf.in (ATtiny261, ATtiny461, ATtiny861): new

View File

@ -90,6 +90,16 @@ static int stk500_getsync(PROGRAMMER * pgm)
* get in sync */
buf[0] = Cmnd_STK_GET_SYNC;
buf[1] = Sync_CRC_EOP;
/*
* First send and drain a few times to get rid of line noise
*/
stk500_send(pgm, buf, 2);
stk500_drain(pgm, 0);
stk500_send(pgm, buf, 2);
stk500_drain(pgm, 0);
stk500_send(pgm, buf, 2);
stk500_recv(pgm, resp, 1);
if (resp[0] != Resp_STK_INSYNC) {