aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/AVRISP/Lib/V2Protocol.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-09 12:22:33 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-09 12:22:33 +0000
commitc647c2763980b374da1c4314c752295d72228d4c (patch)
tree5f8048b90c04d276efb0270907d9a0a7aa55f4fd /Projects/AVRISP/Lib/V2Protocol.c
parent8bb007f80b3e275c9857a5ffa2cf597711fb7478 (diff)
downloadlufa-c647c2763980b374da1c4314c752295d72228d4c.tar.gz
lufa-c647c2763980b374da1c4314c752295d72228d4c.tar.bz2
lufa-c647c2763980b374da1c4314c752295d72228d4c.zip
Minor changes to the AVRISP project for code clarity.
Diffstat (limited to 'Projects/AVRISP/Lib/V2Protocol.c')
-rw-r--r--Projects/AVRISP/Lib/V2Protocol.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Projects/AVRISP/Lib/V2Protocol.c b/Projects/AVRISP/Lib/V2Protocol.c
index 6099234fa..d7343aad6 100644
--- a/Projects/AVRISP/Lib/V2Protocol.c
+++ b/Projects/AVRISP/Lib/V2Protocol.c
@@ -301,11 +301,9 @@ static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)
uint8_t ProgrammingCommands[3];
uint8_t PollValue1;
uint8_t PollValue2;
- uint8_t ProgData[256];
- } Write_Memory_Params;
+ uint8_t ProgData[256]; // Note, the Jungo driver has a very short ACK timeout period, need to buffer the
+ } Write_Memory_Params; // whole page and ACK the packet as fast as possible to prevent it from aborting
- uint8_t* NextWriteByte = Write_Memory_Params.ProgData;
-
Endpoint_Read_Stream_LE(&Write_Memory_Params, sizeof(Write_Memory_Params) - sizeof(Write_Memory_Params.ProgData));
Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);
@@ -329,6 +327,8 @@ static void V2Protocol_Command_ProgramMemory(uint8_t V2Command)
uint16_t PollAddress = 0;
uint8_t PollValue = (V2Command == CMD_PROGRAM_FLASH_ISP) ? Write_Memory_Params.PollValue1 :
Write_Memory_Params.PollValue2;
+ uint8_t* NextWriteByte = Write_Memory_Params.ProgData;
+
if (Write_Memory_Params.ProgrammingMode & PROG_MODE_PAGED_WRITES_MASK)
{
uint16_t StartAddress = (CurrentAddress & 0xFFFF);