if ((ErrorCode = Endpoint_WaitUntilReady()))\r
return ErrorCode;\r
\r
+ #if defined(FAST_STREAM_TRANSFERS)\r
+ uint8_t BytesRemToAlignment = (Endpoint_BytesInEndpoint() & 0x07);\r
+\r
+ if (Length >= 8)\r
+ {\r
+ Length -= BytesRemToAlignment;\r
+\r
+ switch (BytesRemToAlignment)\r
+ {\r
+ default:\r
+ do\r
+ {\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearOUT();\r
+\r
+ #if !defined(NO_STREAM_CALLBACKS)\r
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
+ #endif\r
+\r
+ if ((ErrorCode = Endpoint_WaitUntilReady()))\r
+ return ErrorCode;\r
+ }\r
+\r
+ Length -= 8;\r
+ \r
+ Endpoint_Discard_Byte();\r
+ case 7: Endpoint_Discard_Byte();\r
+ case 6: Endpoint_Discard_Byte();\r
+ case 5: Endpoint_Discard_Byte();\r
+ case 4: Endpoint_Discard_Byte();\r
+ case 3: Endpoint_Discard_Byte();\r
+ case 2: Endpoint_Discard_Byte();\r
+ case 1: Endpoint_Discard_Byte();\r
+ } while (Length >= 8); \r
+ }\r
+ }\r
+ #endif\r
+\r
while (Length)\r
{\r
if (!(Endpoint_IsReadWriteAllowed()))\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
return ErrorCode;\r
\r
+ #if defined(FAST_STREAM_TRANSFERS)\r
+ uint8_t BytesRemToAlignment = (Endpoint_BytesInEndpoint() & 0x07);\r
+\r
+ if (Length >= 8)\r
+ {\r
+ Length -= BytesRemToAlignment;\r
+\r
+ switch (BytesRemToAlignment)\r
+ {\r
+ default:\r
+ do\r
+ {\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearIN();\r
+\r
+ #if !defined(NO_STREAM_CALLBACKS)\r
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
+ #endif\r
+\r
+ if ((ErrorCode = Endpoint_WaitUntilReady()))\r
+ return ErrorCode;\r
+ }\r
+\r
+ Length -= 8;\r
+ \r
+ Endpoint_Write_Byte(*(DataStream++));\r
+ case 7: Endpoint_Write_Byte(*(DataStream++));\r
+ case 6: Endpoint_Write_Byte(*(DataStream++));\r
+ case 5: Endpoint_Write_Byte(*(DataStream++));\r
+ case 4: Endpoint_Write_Byte(*(DataStream++));\r
+ case 3: Endpoint_Write_Byte(*(DataStream++));\r
+ case 2: Endpoint_Write_Byte(*(DataStream++));\r
+ case 1: Endpoint_Write_Byte(*(DataStream++));\r
+ } while (Length >= 8); \r
+ }\r
+ }\r
+ #endif\r
+\r
while (Length)\r
{\r
if (!(Endpoint_IsReadWriteAllowed()))\r
Length--;\r
}\r
}\r
- \r
+\r
return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
return ErrorCode;\r
\r
+ #if defined(FAST_STREAM_TRANSFERS)\r
+ uint8_t BytesRemToAlignment = (Endpoint_BytesInEndpoint() & 0x07);\r
+\r
+ if (Length >= 8)\r
+ {\r
+ Length -= BytesRemToAlignment;\r
+\r
+ switch (BytesRemToAlignment)\r
+ {\r
+ default:\r
+ do\r
+ {\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearIN();\r
+\r
+ #if !defined(NO_STREAM_CALLBACKS)\r
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
+ #endif\r
+\r
+ if ((ErrorCode = Endpoint_WaitUntilReady()))\r
+ return ErrorCode;\r
+ }\r
+\r
+ Length -= 8;\r
+ \r
+ Endpoint_Write_Byte(*(DataStream--));\r
+ case 7: Endpoint_Write_Byte(*(DataStream--));\r
+ case 6: Endpoint_Write_Byte(*(DataStream--));\r
+ case 5: Endpoint_Write_Byte(*(DataStream--));\r
+ case 4: Endpoint_Write_Byte(*(DataStream--));\r
+ case 3: Endpoint_Write_Byte(*(DataStream--));\r
+ case 2: Endpoint_Write_Byte(*(DataStream--));\r
+ case 1: Endpoint_Write_Byte(*(DataStream--));\r
+ } while (Length >= 8); \r
+ }\r
+ }\r
+ #endif\r
+\r
while (Length)\r
{\r
if (!(Endpoint_IsReadWriteAllowed()))\r
Length--;\r
}\r
}\r
- \r
+\r
return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
return ErrorCode;\r
\r
+ #if defined(FAST_STREAM_TRANSFERS)\r
+ uint8_t BytesRemToAlignment = (Endpoint_BytesInEndpoint() & 0x07);\r
+\r
+ if (Length >= 8)\r
+ {\r
+ Length -= BytesRemToAlignment;\r
+\r
+ switch (BytesRemToAlignment)\r
+ {\r
+ default:\r
+ do\r
+ {\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearOUT();\r
+\r
+ #if !defined(NO_STREAM_CALLBACKS)\r
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
+ #endif\r
+\r
+ if ((ErrorCode = Endpoint_WaitUntilReady()))\r
+ return ErrorCode;\r
+ }\r
+\r
+ Length -= 8;\r
+ \r
+ *(DataStream++) = Endpoint_Read_Byte();\r
+ case 7: *(DataStream++) = Endpoint_Read_Byte();\r
+ case 6: *(DataStream++) = Endpoint_Read_Byte();\r
+ case 5: *(DataStream++) = Endpoint_Read_Byte();\r
+ case 4: *(DataStream++) = Endpoint_Read_Byte();\r
+ case 3: *(DataStream++) = Endpoint_Read_Byte();\r
+ case 2: *(DataStream++) = Endpoint_Read_Byte();\r
+ case 1: *(DataStream++) = Endpoint_Read_Byte();\r
+ } while (Length >= 8); \r
+ }\r
+ }\r
+ #endif\r
+\r
while (Length)\r
{\r
if (!(Endpoint_IsReadWriteAllowed()))\r
Length--;\r
}\r
}\r
- \r
+\r
return ENDPOINT_RWSTREAM_NoError;\r
}\r
\r
if ((ErrorCode = Endpoint_WaitUntilReady()))\r
return ErrorCode;\r
\r
+ #if defined(FAST_STREAM_TRANSFERS)\r
+ uint8_t BytesRemToAlignment = (Endpoint_BytesInEndpoint() & 0x07);\r
+\r
+ if (Length >= 8)\r
+ {\r
+ Length -= BytesRemToAlignment;\r
+\r
+ switch (BytesRemToAlignment)\r
+ {\r
+ default:\r
+ do\r
+ {\r
+ if (!(Endpoint_IsReadWriteAllowed()))\r
+ {\r
+ Endpoint_ClearOUT();\r
+\r
+ #if !defined(NO_STREAM_CALLBACKS)\r
+ if ((Callback != NULL) && (Callback() == STREAMCALLBACK_Abort))\r
+ return ENDPOINT_RWSTREAM_CallbackAborted;\r
+ #endif\r
+\r
+ if ((ErrorCode = Endpoint_WaitUntilReady()))\r
+ return ErrorCode;\r
+ }\r
+\r
+ Length -= 8;\r
+ \r
+ *(DataStream--) = Endpoint_Read_Byte();\r
+ case 7: *(DataStream--) = Endpoint_Read_Byte();\r
+ case 6: *(DataStream--) = Endpoint_Read_Byte();\r
+ case 5: *(DataStream--) = Endpoint_Read_Byte();\r
+ case 4: *(DataStream--) = Endpoint_Read_Byte();\r
+ case 3: *(DataStream--) = Endpoint_Read_Byte();\r
+ case 2: *(DataStream--) = Endpoint_Read_Byte();\r
+ case 1: *(DataStream--) = Endpoint_Read_Byte();\r
+ } while (Length >= 8); \r
+ }\r
+ }\r
+ #endif\r
+\r
while (Length)\r
{\r
if (!(Endpoint_IsReadWriteAllowed()))\r
Length--;\r
}\r
}\r
- \r
+\r
return ENDPOINT_RWSTREAM_NoError;\r
}\r
#endif\r