X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c6d6bdae0a6fa5604174428787ff3c415ca73fad..18b82b3575162c2c6d462c8f34a7d942f77a88ec:/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c index 58df78559..ede236280 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2011. + Copyright (C) Dean Camera, 2012. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - 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 @@ -120,7 +120,7 @@ void XPROGTarget_DisableTargetTPI(void) /* Set all USART lines as inputs, tristate */ DDRD &= ~((1 << 5) | (1 << 3)); PORTD &= ~((1 << 5) | (1 << 3) | (1 << 2)); - + /* Tristate target /RESET line */ AUX_LINE_DDR &= ~AUX_LINE_MASK; AUX_LINE_PORT &= ~AUX_LINE_MASK; @@ -155,6 +155,9 @@ uint8_t XPROGTarget_ReceiveByte(void) /* Wait until a byte has been received before reading */ while (!(UCSR1A & (1 << RXC1)) && !(TimeoutExpired)); + /* Byte of data received - reset the timeout */ + wdt_reset(); + return UDR1; } @@ -164,7 +167,7 @@ void XPROGTarget_SendIdle(void) /* Switch to Tx mode if currently in Rx mode */ if (!(IsSending)) XPROGTarget_SetTxMode(); - + /* Need to do nothing for a full frame to send an IDLE */ for (uint8_t i = 0; i < BITS_IN_USART_FRAME; i++) {