X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1ed6925b5bf417848b83887b32e3ede05a1c691b..f69f03cb0d02937dee018264f0ac4e9be76fc1f4:/Projects/AVRISP/Lib/ISPProtocol.c diff --git a/Projects/AVRISP/Lib/ISPProtocol.c b/Projects/AVRISP/Lib/ISPProtocol.c index bfd917a09..c023234c3 100644 --- a/Projects/AVRISP/Lib/ISPProtocol.c +++ b/Projects/AVRISP/Lib/ISPProtocol.c @@ -61,7 +61,7 @@ void ISPProtocol_EnterISPMode(void) CurrentAddress = 0; - V2Protocol_DelayMS(Enter_ISP_Params.ExecutionDelayMS); + V2Protocol_DelayMS(Enter_ISP_Params.ExecutionDelayMS); SPI_Init(ISPTarget_GetSPIPrescalerMask() | SPI_SCK_LEAD_RISING | SPI_SAMPLE_LEADING | SPI_MODE_MASTER); while (Enter_ISP_Params.SynchLoops-- && (ResponseStatus == STATUS_CMD_FAILED)) @@ -136,7 +136,10 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command) 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 - Endpoint_Read_Stream_LE(&Write_Memory_Params, sizeof(Write_Memory_Params) - sizeof(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); if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData))