projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move LUFA compile time options to a new section in the application makefiles for...
[pub/USBasp.git]
/
LUFA
/
Drivers
/
USB
/
LowLevel
/
Pipe.c
diff --git
a/LUFA/Drivers/USB/LowLevel/Pipe.c
b/LUFA/Drivers/USB/LowLevel/Pipe.c
index
4bd89ec
..
189aaa6
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/
LUFA/Drivers/USB/LowLevel/Pipe.c
@@
-45,7
+45,7
@@
bool Pipe_ConfigurePipe(const uint8_t Number, const uint8_t Type, const uint8_t
\r
UPCFG1X = 0;
\r
\r
\r
UPCFG1X = 0;
\r
\r
- UPCFG0X = ((Type << EPTYPE0) | Token | (
EndpointNumber
<< PEPNUM0));
\r
+ UPCFG0X = ((Type << EPTYPE0) | Token | (
(EndpointNumber & PIPE_EPNUM_MASK)
<< PEPNUM0));
\r
UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
\r
\r
return Pipe_IsConfigured();
\r
UPCFG1X = ((1 << ALLOC) | Banks | Pipe_BytesToEPSizeMask(Size));
\r
\r
return Pipe_IsConfigured();
\r
@@
-70,9
+70,11
@@
void Pipe_ClearPipes(void)
\r
uint8_t Pipe_WaitUntilReady(void)
\r
{
\r
\r
uint8_t Pipe_WaitUntilReady(void)
\r
{
\r
+ #if (USB_STREAM_TIMEOUT_MS < 0xFF)
\r
+ uint8_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
\r
+ #else
\r
uint16_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
\r
uint16_t TimeoutMSRem = USB_STREAM_TIMEOUT_MS;
\r
-
\r
- USB_INT_Clear(USB_INT_HSOFI);
\r
+ #endif
\r
\r
for (;;)
\r
{
\r
\r
for (;;)
\r
{
\r
@@
-104,7
+106,7
@@
uint8_t Pipe_WaitUntilReady(void)
\r
uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
\r
uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
- ,
uint8_t (* const Callback)(void)
\r
+ ,
StreamCallbackPtr_t Callback
\r
#endif
\r
)
\r
{
\r
#endif
\r
)
\r
{
\r
@@
-122,7
+124,7
@@
uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
- return PIPE_RWSTREAM_
ERROR_
CallbackAborted;
\r
+ return PIPE_RWSTREAM_CallbackAborted;
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
@@
-135,12
+137,12
@@
uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
}
\r
}
\r
\r
}
\r
}
\r
\r
- return PIPE_RWSTREAM_
ERROR_
NoError;
\r
+ return PIPE_RWSTREAM_NoError;
\r
}
\r
\r
uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
}
\r
\r
uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
- ,
uint8_t (* const Callback)(void)
\r
+ ,
StreamCallbackPtr_t Callback
\r
#endif
\r
)
\r
{
\r
#endif
\r
)
\r
{
\r
@@
-158,7
+160,7
@@
uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
- return PIPE_RWSTREAM_
ERROR_
CallbackAborted;
\r
+ return PIPE_RWSTREAM_CallbackAborted;
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
@@
-171,12
+173,12
@@
uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
}
\r
}
\r
\r
}
\r
}
\r
\r
- return PIPE_RWSTREAM_
ERROR_
NoError;
\r
+ return PIPE_RWSTREAM_NoError;
\r
}
\r
\r
uint8_t Pipe_Discard_Stream(uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
}
\r
\r
uint8_t Pipe_Discard_Stream(uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
- ,
uint8_t (* const Callback)(void)
\r
+ ,
StreamCallbackPtr_t Callback
\r
#endif
\r
)
\r
{
\r
#endif
\r
)
\r
{
\r
@@
-193,7
+195,7
@@
uint8_t Pipe_Discard_Stream(uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
- return PIPE_RWSTREAM_
ERROR_
CallbackAborted;
\r
+ return PIPE_RWSTREAM_CallbackAborted;
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
@@
-206,12
+208,12
@@
uint8_t Pipe_Discard_Stream(uint16_t Length
}
\r
}
\r
\r
}
\r
}
\r
\r
- return PIPE_RWSTREAM_
ERROR_
NoError;
\r
+ return PIPE_RWSTREAM_NoError;
\r
}
\r
\r
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
}
\r
\r
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
- ,
uint8_t (* const Callback)(void)
\r
+ ,
StreamCallbackPtr_t Callback
\r
#endif
\r
)
\r
{
\r
#endif
\r
)
\r
{
\r
@@
-229,7
+231,7
@@
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
- return PIPE_RWSTREAM_
ERROR_
CallbackAborted;
\r
+ return PIPE_RWSTREAM_CallbackAborted;
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
@@
-242,12
+244,12
@@
uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
}
\r
}
\r
\r
}
\r
}
\r
\r
- return PIPE_RWSTREAM_
ERROR_
NoError;
\r
+ return PIPE_RWSTREAM_NoError;
\r
}
\r
\r
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
}
\r
\r
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
- ,
uint8_t (* const Callback)(void)
\r
+ ,
StreamCallbackPtr_t Callback
\r
#endif
\r
)
\r
{
\r
#endif
\r
)
\r
{
\r
@@
-265,7
+267,7
@@
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
\r
#if !defined(NO_STREAM_CALLBACKS)
\r
if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))
\r
- return PIPE_RWSTREAM_
ERROR_
CallbackAborted;
\r
+ return PIPE_RWSTREAM_CallbackAborted;
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
#endif
\r
\r
if ((ErrorCode = Pipe_WaitUntilReady()))
\r
@@
-278,7
+280,7
@@
uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length
}
\r
}
\r
\r
}
\r
}
\r
\r
- return PIPE_RWSTREAM_
ERROR_
NoError;
\r
+ return PIPE_RWSTREAM_NoError;
\r
}
\r
\r
#endif
\r
}
\r
\r
#endif
\r