X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/1ed6925b5bf417848b83887b32e3ede05a1c691b..7aecda6fda5bcced68d72b0cf73d00174aa5c7cd:/Projects/AVRISP/Lib/ISPProtocol.c diff --git a/Projects/AVRISP/Lib/ISPProtocol.c b/Projects/AVRISP/Lib/ISPProtocol.c index bfd917a09..6e81ac8e4 100644 --- a/Projects/AVRISP/Lib/ISPProtocol.c +++ b/Projects/AVRISP/Lib/ISPProtocol.c @@ -28,6 +28,8 @@ this software. */ +#if defined(ENABLE_ISP_PROTOCOL) || defined(__DOXYGEN__) + /** \file * * ISP Protocol handler, to process V2 Protocol wrapped ISP commands used in Atmel programmer devices. @@ -61,7 +63,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 +138,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)) @@ -465,3 +470,5 @@ void ISPProtocol_SPIMulti(void) Endpoint_Write_Byte(STATUS_CMD_OK); Endpoint_ClearIN(); } + +#endif \ No newline at end of file