From f555ad7ced743a19eb1eefaf5eaf536fcbe58d80 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 10 Jan 2011 18:43:34 +0000 Subject: Altered all endpoint/pipe stream transfers so that the new BytesProcessed parameter now points to a location where the number of bytes in the transfer that have been completed can be stored (or NULL if entire transaction should be performed in one chunk). Added new Endpoint_Null_Stream() and Pipe_Null_stream() functions. Removed the NO_STREAM_CALLBACKS compile time option due to the new partial stream transfer feature replacing it. Fixed errors in the incomplete Test and Measurement device demo preventing proper operation (thanks to Pavel Plotnikov). --- Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c | 20 ++++++++++---------- Projects/AVRISP-MKII/Lib/V2Protocol.c | 4 ++-- Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'Projects/AVRISP-MKII/Lib') diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c index 5b1e8d550..9a732dea2 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c @@ -54,7 +54,7 @@ void ISPProtocol_EnterISPMode(void) uint8_t EnterProgBytes[4]; } Enter_ISP_Params; - Endpoint_Read_Stream_LE(&Enter_ISP_Params, sizeof(Enter_ISP_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Enter_ISP_Params, sizeof(Enter_ISP_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -109,7 +109,7 @@ void ISPProtocol_LeaveISPMode(void) uint8_t PostDelayMS; } Leave_ISP_Params; - Endpoint_Read_Stream_LE(&Leave_ISP_Params, sizeof(Leave_ISP_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Leave_ISP_Params, sizeof(Leave_ISP_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -145,7 +145,7 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command) } 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)), NO_STREAM_CALLBACK); + sizeof(Write_Memory_Params.ProgData)), NULL); Write_Memory_Params.BytesToWrite = SwapEndian_16(Write_Memory_Params.BytesToWrite); if (Write_Memory_Params.BytesToWrite > sizeof(Write_Memory_Params.ProgData)) @@ -160,7 +160,7 @@ void ISPProtocol_ProgramMemory(uint8_t V2Command) return; } - Endpoint_Read_Stream_LE(&Write_Memory_Params.ProgData, Write_Memory_Params.BytesToWrite, NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Write_Memory_Params.ProgData, Write_Memory_Params.BytesToWrite, NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -279,7 +279,7 @@ void ISPProtocol_ReadMemory(uint8_t V2Command) uint8_t ReadMemoryCommand; } Read_Memory_Params; - Endpoint_Read_Stream_LE(&Read_Memory_Params, sizeof(Read_Memory_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Read_Memory_Params, sizeof(Read_Memory_Params), NULL); Read_Memory_Params.BytesToRead = SwapEndian_16(Read_Memory_Params.BytesToRead); Endpoint_ClearOUT(); @@ -353,7 +353,7 @@ void ISPProtocol_ChipErase(void) uint8_t EraseCommandBytes[4]; } Erase_Chip_Params; - Endpoint_Read_Stream_LE(&Erase_Chip_Params, sizeof(Erase_Chip_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Erase_Chip_Params, sizeof(Erase_Chip_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -389,7 +389,7 @@ void ISPProtocol_ReadFuseLockSigOSCCAL(uint8_t V2Command) uint8_t ReadCommandBytes[4]; } Read_FuseLockSigOSCCAL_Params; - Endpoint_Read_Stream_LE(&Read_FuseLockSigOSCCAL_Params, sizeof(Read_FuseLockSigOSCCAL_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Read_FuseLockSigOSCCAL_Params, sizeof(Read_FuseLockSigOSCCAL_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -420,7 +420,7 @@ void ISPProtocol_WriteFuseLock(uint8_t V2Command) uint8_t WriteCommandBytes[4]; } Write_FuseLockSig_Params; - Endpoint_Read_Stream_LE(&Write_FuseLockSig_Params, sizeof(Write_FuseLockSig_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Write_FuseLockSig_Params, sizeof(Write_FuseLockSig_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -447,8 +447,8 @@ void ISPProtocol_SPIMulti(void) uint8_t TxData[255]; } SPI_Multi_Params; - Endpoint_Read_Stream_LE(&SPI_Multi_Params, (sizeof(SPI_Multi_Params) - sizeof(SPI_Multi_Params.TxData)), NO_STREAM_CALLBACK); - Endpoint_Read_Stream_LE(&SPI_Multi_Params.TxData, SPI_Multi_Params.TxBytes, NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&SPI_Multi_Params, (sizeof(SPI_Multi_Params) - sizeof(SPI_Multi_Params.TxData)), NULL); + Endpoint_Read_Stream_LE(&SPI_Multi_Params.TxData, SPI_Multi_Params.TxBytes, NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); diff --git a/Projects/AVRISP-MKII/Lib/V2Protocol.c b/Projects/AVRISP-MKII/Lib/V2Protocol.c index b7ab91cca..f6ea47709 100644 --- a/Projects/AVRISP-MKII/Lib/V2Protocol.c +++ b/Projects/AVRISP-MKII/Lib/V2Protocol.c @@ -185,7 +185,7 @@ static void V2Protocol_SignOn(void) Endpoint_Write_Byte(CMD_SIGN_ON); Endpoint_Write_Byte(STATUS_CMD_OK); Endpoint_Write_Byte(sizeof(PROGRAMMER_ID) - 1); - Endpoint_Write_Stream_LE(PROGRAMMER_ID, (sizeof(PROGRAMMER_ID) - 1), NO_STREAM_CALLBACK); + Endpoint_Write_Stream_LE(PROGRAMMER_ID, (sizeof(PROGRAMMER_ID) - 1), NULL); Endpoint_ClearIN(); } @@ -249,7 +249,7 @@ static void V2Protocol_GetSetParam(const uint8_t V2Command) */ static void V2Protocol_LoadAddress(void) { - Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_BE(&CurrentAddress, sizeof(CurrentAddress), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c index 1b91c3c0e..c89f94fe4 100644 --- a/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c +++ b/Projects/AVRISP-MKII/Lib/XPROG/XPROGProtocol.c @@ -62,7 +62,7 @@ void XPROGProtocol_SetMode(void) uint8_t Protocol; } SetMode_XPROG_Params; - Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&SetMode_XPROG_Params, sizeof(SetMode_XPROG_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -163,7 +163,7 @@ static void XPROGProtocol_Erase(void) uint32_t Address; } Erase_XPROG_Params; - Endpoint_Read_Stream_LE(&Erase_XPROG_Params, sizeof(Erase_XPROG_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&Erase_XPROG_Params, sizeof(Erase_XPROG_Params), NULL); Erase_XPROG_Params.Address = SwapEndian_32(Erase_XPROG_Params.Address); Endpoint_ClearOUT(); @@ -243,10 +243,10 @@ static void XPROGProtocol_WriteMemory(void) } WriteMemory_XPROG_Params; Endpoint_Read_Stream_LE(&WriteMemory_XPROG_Params, (sizeof(WriteMemory_XPROG_Params) - - sizeof(WriteMemory_XPROG_Params).ProgData), NO_STREAM_CALLBACK); + sizeof(WriteMemory_XPROG_Params).ProgData), NULL); WriteMemory_XPROG_Params.Address = SwapEndian_32(WriteMemory_XPROG_Params.Address); WriteMemory_XPROG_Params.Length = SwapEndian_16(WriteMemory_XPROG_Params.Length); - Endpoint_Read_Stream_LE(&WriteMemory_XPROG_Params.ProgData, WriteMemory_XPROG_Params.Length, NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&WriteMemory_XPROG_Params.ProgData, WriteMemory_XPROG_Params.Length, NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); @@ -326,7 +326,7 @@ static void XPROGProtocol_ReadMemory(void) uint16_t Length; } ReadMemory_XPROG_Params; - Endpoint_Read_Stream_LE(&ReadMemory_XPROG_Params, sizeof(ReadMemory_XPROG_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&ReadMemory_XPROG_Params, sizeof(ReadMemory_XPROG_Params), NULL); ReadMemory_XPROG_Params.Address = SwapEndian_32(ReadMemory_XPROG_Params.Address); ReadMemory_XPROG_Params.Length = SwapEndian_16(ReadMemory_XPROG_Params.Length); @@ -354,7 +354,7 @@ static void XPROGProtocol_ReadMemory(void) Endpoint_Write_Byte(ReturnStatus); if (ReturnStatus == XPRG_ERR_OK) - Endpoint_Write_Stream_LE(ReadBuffer, ReadMemory_XPROG_Params.Length, NO_STREAM_CALLBACK); + Endpoint_Write_Stream_LE(ReadBuffer, ReadMemory_XPROG_Params.Length, NULL); Endpoint_ClearIN(); } @@ -371,7 +371,7 @@ static void XPROGProtocol_ReadCRC(void) uint8_t CRCType; } ReadCRC_XPROG_Params; - Endpoint_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NO_STREAM_CALLBACK); + Endpoint_Read_Stream_LE(&ReadCRC_XPROG_Params, sizeof(ReadCRC_XPROG_Params), NULL); Endpoint_ClearOUT(); Endpoint_SelectEndpoint(AVRISP_DATA_IN_EPNUM); -- cgit v1.2.3