projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move new Class Driver powered demos to a new ClassDriver subdirectory, re-add old...
[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
..
720da17
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/
LUFA/Drivers/USB/LowLevel/Pipe.c
@@
-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
@@
-92,9
+94,9
@@
uint8_t Pipe_WaitUntilReady(void)
else if (!(USB_IsConnected))
\r
return PIPE_READYWAIT_DeviceDisconnected;
\r
\r
else if (!(USB_IsConnected))
\r
return PIPE_READYWAIT_DeviceDisconnected;
\r
\r
- if (
USB_INT_HasOccurred(USB_INT_HSOFI)
)
\r
+ if (
FrameElapsed
)
\r
{
\r
{
\r
-
USB_INT_Clear(USB_INT_HSOFI)
;
\r
+
FrameElapsed = false
;
\r
\r
if (!(TimeoutMSRem--))
\r
return PIPE_READYWAIT_Timeout;
\r
\r
if (!(TimeoutMSRem--))
\r
return PIPE_READYWAIT_Timeout;
\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