/** Handler for the CMD_ENTER_PROGMODE_ISP command, which attempts to enter programming mode on\r
* the attached device, returning success or failure back to the host.\r
*/\r
/** Handler for the CMD_ENTER_PROGMODE_ISP command, which attempts to enter programming mode on\r
* the attached device, returning success or failure back to the host.\r
*/\r
SPI_Init(ISPTarget_GetSPIPrescalerMask() | SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING | SPI_MODE_MASTER);\r
\r
while (Enter_ISP_Params.SynchLoops-- && (ResponseStatus == STATUS_CMD_FAILED))\r
SPI_Init(ISPTarget_GetSPIPrescalerMask() | SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING | SPI_MODE_MASTER);\r
\r
while (Enter_ISP_Params.SynchLoops-- && (ResponseStatus == STATUS_CMD_FAILED))\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 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
- Endpoint_Read_Stream_LE(&Write_Memory_Params, sizeof(Write_Memory_Params) - sizeof(Write_Memory_Params.ProgData));\r
+ Endpoint_Read_Stream_LE(&Write_Memory_Params, (sizeof(Write_Memory_Params) -\r
+ sizeof(Write_Memory_Params.ProgData)));\r
+\r
+\r
Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);\r
\r
if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData))\r
Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite);\r
\r
if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData))\r