aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP/Lib/V2ProtocolTarget.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-28 08:24:50 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-28 08:24:50 +0000
commit4bb236e9a05c5bae7a3ae6ee5c17572fa6af7d61 (patch)
treea28b86f2a5781512ddf67fcf211236528c6583fe /Projects/AVRISP/Lib/V2ProtocolTarget.c
parent489515fbbf0f61ae63bcdd4b858a5fe59e90c0be (diff)
downloadlufa-4bb236e9a05c5bae7a3ae6ee5c17572fa6af7d61.tar.gz
lufa-4bb236e9a05c5bae7a3ae6ee5c17572fa6af7d61.tar.bz2
lufa-4bb236e9a05c5bae7a3ae6ee5c17572fa6af7d61.zip
Increase AVRISP command timeout to 240ms up from 150ms to prevent some ISP commands from timing out too early.
Add check to the PROGRAM FLASH ISP and PROGRAM EEPROM ISP handler to return an explicit error when the host attempts to write more data than the device is able to buffer.
Diffstat (limited to 'Projects/AVRISP/Lib/V2ProtocolTarget.c')
-rw-r--r--Projects/AVRISP/Lib/V2ProtocolTarget.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Projects/AVRISP/Lib/V2ProtocolTarget.c b/Projects/AVRISP/Lib/V2ProtocolTarget.c
index 9c6ccf4c6..24cd941a4 100644
--- a/Projects/AVRISP/Lib/V2ProtocolTarget.c
+++ b/Projects/AVRISP/Lib/V2ProtocolTarget.c
@@ -155,13 +155,15 @@ uint8_t V2Protocol_WaitWhileTargetBusy(void)
{
TCNT0 = 0;
+ bool DeviceBusy;
+
do
{
SPI_SendByte(0xF0);
SPI_SendByte(0x00);
SPI_SendByte(0x00);
- bool DeviceBusy = (SPI_ReceiveByte() & 0x01);
+ DeviceBusy = (SPI_ReceiveByte() & 0x01);
}
while (DeviceBusy && (TCNT0 < TARGET_BUSY_TIMEOUT_MS));