diff options
-rw-r--r-- | Projects/AVRISP/Lib/V2Protocol.c | 2 | ||||
-rw-r--r-- | Projects/AVRISP/Lib/V2ProtocolTarget.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Projects/AVRISP/Lib/V2Protocol.c b/Projects/AVRISP/Lib/V2Protocol.c index 248c50d24..3a1b78efd 100644 --- a/Projects/AVRISP/Lib/V2Protocol.c +++ b/Projects/AVRISP/Lib/V2Protocol.c @@ -301,7 +301,7 @@ static void V2Protocol_Command_ProgramMemory(uint8_t V2Command) uint8_t ProgrammingCommands[3];
uint8_t PollValue1;
uint8_t PollValue2;
- uint8_t ProgData[512];
+ uint8_t ProgData[256];
} Write_Memory_Params;
uint8_t* NextWriteByte = Write_Memory_Params.ProgData;
diff --git a/Projects/AVRISP/Lib/V2ProtocolTarget.c b/Projects/AVRISP/Lib/V2ProtocolTarget.c index d06f06510..9c6ccf4c6 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;
|