Endpoint_SelectEndpoint(AVRISP_DATA_EPNUM);\r
- /* Check to see if a V2 Protocol command has been received - if not, abort */
- if (!(Endpoint_IsOUTReceived()))
- return;
-
- /* Pass off processing of the V2 Protocol command to the V2 Protocol handler */
- V2Protocol_ProcessCommand();\r
+ /* Check to see if a V2 Protocol command has been received */
+ if (Endpoint_IsOUTReceived())\r
+ {
+ /* Pass off processing of the V2 Protocol command to the V2 Protocol handler */
+ V2Protocol_ProcessCommand();\r
+ }\r
}
uint8_t ProgrammingCommands[3];\r
uint8_t PollValue1;\r
uint8_t PollValue2;\r
- uint8_t ProgData[256];\r
- } Write_Memory_Params;\r
+ uint8_t ProgData[256]; // Note, the Jungo driver has a very short ACK timeout period, need to buffer the\r
+ } Write_Memory_Params; // whole page and ACK the packet as fast as possible to prevent it from aborting\r
\r
- uint8_t* NextWriteByte = Write_Memory_Params.ProgData;\r
-\r
Endpoint_Read_Stream_LE(&Write_Memory_Params, sizeof(Write_Memory_Params) - sizeof(Write_Memory_Params.ProgData));\r
Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);\r
\r
uint16_t PollAddress = 0;\r
uint8_t PollValue = (V2Command == CMD_PROGRAM_FLASH_ISP) ? Write_Memory_Params.PollValue1 :\r
Write_Memory_Params.PollValue2;\r
+ uint8_t* NextWriteByte = Write_Memory_Params.ProgData;\r
+\r
if (Write_Memory_Params.ProgrammingMode & PROG_MODE_PAGED_WRITES_MASK)\r
{\r
uint16_t StartAddress = (CurrentAddress & 0xFFFF);\r
{\r
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);\r
\r
- if (ParamInfo == NULL)\r
+ if ((ParamInfo == NULL) || !(ParamInfo->ParamPrivellages & PARAM_PRIV_READ))\r
return 0;\r
\r
return ParamInfo->ParamValue;\r
{\r
ParameterItem_t* ParamInfo = V2Params_GetParamFromTable(ParamID);\r
\r
- if (ParamInfo == NULL)\r
+ if ((ParamInfo == NULL) || !(ParamInfo->ParamPrivellages & PARAM_PRIV_WRITE))\r
return;\r
\r
ParamInfo->ParamValue = Value;\r
{\r
if (ResetTarget)\r
{\r
- RESET_LINE_DDR |= RESET_LINE_MASK;\r
+ RESET_LINE_DDR |= RESET_LINE_MASK;\r
\r
if (!(V2Params_GetParameterValue(PARAM_RESET_POLARITY)))\r
RESET_LINE_PORT |= RESET_LINE_MASK;\r
{\r
TCNT0 = 0;\r
\r
- bool DeviceBusy;\r
- \r
do\r
{\r
SPI_SendByte(0xF0);\r
SPI_SendByte(0x00);\r
\r
SPI_SendByte(0x00);\r
- DeviceBusy = (SPI_ReceiveByte() & 0x01);\r
}\r
- while (DeviceBusy && (TCNT0 < TARGET_BUSY_TIMEOUT_MS));\r
+ while ((SPI_ReceiveByte() & 0x01) && (TCNT0 < TARGET_BUSY_TIMEOUT_MS));\r
\r
if (TCNT0 >= TARGET_BUSY_TIMEOUT_MS)\r
return STATUS_RDY_BSY_TOUT;\r