X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/de70f0f1cf034d8f22141a2825f24ad60d14421b..4f74075fad7f1e7a35d04ff534d9d6a57d2b97fc:/LUFA/Drivers/USB/LowLevel/Pipe.c?ds=inline diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index bc497ad3b..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; @@ -204,7 +204,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -212,7 +212,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -220,7 +220,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -228,7 +228,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -236,7 +236,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -244,7 +244,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -252,7 +252,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -260,7 +260,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -268,7 +268,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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 @@ -276,7 +276,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length #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