aboutsummaryrefslogtreecommitdiff
path: root/Projects/AVRISP/Lib/V2ProtocolTarget.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2009-08-27 23:07:53 +0000
committerDean Camera <[email protected]>2009-08-27 23:07:53 +0000
commit489515fbbf0f61ae63bcdd4b858a5fe59e90c0be (patch)
tree357be26ea97f9274be49990db044d506d60a639a /Projects/AVRISP/Lib/V2ProtocolTarget.c
parent94c899d7b7b84cd170d75e1fbb4e696cf3447c27 (diff)
downloadqmk_firmware-489515fbbf0f61ae63bcdd4b858a5fe59e90c0be.tar.gz
qmk_firmware-489515fbbf0f61ae63bcdd4b858a5fe59e90c0be.zip
Make WaitWhileBusy function in the AVRISP project more explicit about how it sends and receives the busy check command.
Reduce size of PROGRAM FLASH ISP or PROGRAM EEPROM ISP buffer to 256 bytes to prevent blowing the stack on the smallest USB AVR models.
Diffstat (limited to 'Projects/AVRISP/Lib/V2ProtocolTarget.c')
-rw-r--r--Projects/AVRISP/Lib/V2ProtocolTarget.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Projects/AVRISP/Lib/V2ProtocolTarget.c b/Projects/AVRISP/Lib/V2ProtocolTarget.c
index d06f06510e..9c6ccf4c62 100644
--- a/Projects/AVRISP/Lib/V2ProtocolTarget.c
+++ b/Projects/AVRISP/Lib/V2ProtocolTarget.c
@@ -161,8 +161,9 @@ uint8_t V2Protocol_WaitWhileTargetBusy(void)
SPI_SendByte(0x00);
SPI_SendByte(0x00);
+ bool DeviceBusy = (SPI_ReceiveByte() & 0x01);
}
- while ((SPI_ReceiveByte() & 0x01) && (TCNT0 < TARGET_BUSY_TIMEOUT_MS));
+ while (DeviceBusy && (TCNT0 < TARGET_BUSY_TIMEOUT_MS));
if (TCNT0 >= TARGET_BUSY_TIMEOUT_MS)
return STATUS_RDY_BSY_TOUT;