Make sure CRC value is pre-zeroed before reading from the XMEGA target device, to...
[pub/USBasp.git] / Projects / AVRISP-MKII / Lib / XPROG / XPROGTarget.c
index 471ebee..b2f5552 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -153,10 +153,7 @@ uint8_t XPROGTarget_ReceiveByte(void)
          XPROGTarget_SetRxMode();
 
        /* Wait until a byte has been received before reading */
-       while (!(UCSR1A & (1 << RXC1)) && !(TimeoutExpired));
-
-       /* Byte of data received - reset the timeout */
-       wdt_reset();
+       while (!(UCSR1A & (1 << RXC1)) && TimeoutTicksRemaining);
 
        return UDR1;
 }