X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/9d6a373cb61b55b94312de3809ac76fcbd0a696c..4f74075fad7f1e7a35d04ff534d9d6a57d2b97fc:/LUFA/Drivers/USB/LowLevel/Pipe.c diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index 400cc5f02..fd8f81bc6 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.c +++ b/LUFA/Drivers/USB/LowLevel/Pipe.c @@ -78,7 +78,7 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress) { Pipe_SelectPipe(PNum); - if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == EndpointAddress)) + if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK))) return true; } @@ -130,7 +130,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length { uint8_t ErrorCode; - Pipe_SetToken(PIPE_TOKEN_IN); + Pipe_SetPipeToken(PIPE_TOKEN_IN); if ((ErrorCode = Pipe_WaitUntilReady())) return ErrorCode; @@ -200,73 +200,83 @@ uint8_t Pipe_Discard_Stream(uint16_t Length } #define TEMPLATE_FUNC_NAME Pipe_Write_Stream_LE +#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT() #define TEMPLATE_BUFFER_OFFSET(Length) 0 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*(BufferPtr++)) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*((uint8_t*)BufferPtr++)) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Write_PStream_LE +#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT() #define TEMPLATE_BUFFER_OFFSET(Length) 0 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr++)) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++)) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Write_EStream_LE +#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT() #define TEMPLATE_BUFFER_OFFSET(Length) 0 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr++)) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++)) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Write_Stream_BE +#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT() #define TEMPLATE_BUFFER_OFFSET(Length) Length - 1 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*(BufferPtr--)) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*((uint8_t*)BufferPtr--)) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Write_PStream_BE +#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT() #define TEMPLATE_BUFFER_OFFSET(Length) Length - 1 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr--)) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr--)) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Write_EStream_BE +#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT() #define TEMPLATE_BUFFER_OFFSET(Length) Length - 1 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr--)) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--)) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Read_Stream_LE +#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_TOKEN PIPE_TOKEN_IN #define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN() #define TEMPLATE_BUFFER_OFFSET(Length) 0 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *(BufferPtr++) = Pipe_Read_Byte() +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Pipe_Read_Byte() #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Read_EStream_LE +#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_TOKEN PIPE_TOKEN_IN #define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN() #define TEMPLATE_BUFFER_OFFSET(Length) 0 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte(BufferPtr++, Pipe_Read_Byte()) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Pipe_Read_Byte()) #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Read_Stream_BE +#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_TOKEN PIPE_TOKEN_IN #define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN() #define TEMPLATE_BUFFER_OFFSET(Length) Length - 1 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *(BufferPtr--) = Pipe_Read_Byte() +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Pipe_Read_Byte() #include "Template/Template_Pipe_RW.c" #define TEMPLATE_FUNC_NAME Pipe_Read_EStream_BE +#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_TOKEN PIPE_TOKEN_IN #define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN() #define TEMPLATE_BUFFER_OFFSET(Length) Length - 1 -#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte(BufferPtr--, Pipe_Read_Byte()) +#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Pipe_Read_Byte()) #include "Template/Template_Pipe_RW.c" #endif