Create a new function pointer type in StreamCallbacks.h for endpoint/pipe stream...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 15 May 2009 12:27:32 +0000 (12:27 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 15 May 2009 12:27:32 +0000 (12:27 +0000)
Demos/Host/CDCHost/CDCHost.c
LUFA/ChangeLog.txt
LUFA/CompileTimeTokens.txt
LUFA/Drivers/USB/Class/ConfigDescriptor.c
LUFA/Drivers/USB/Class/ConfigDescriptor.h
LUFA/Drivers/USB/HighLevel/StreamCallbacks.h
LUFA/Drivers/USB/LowLevel/Endpoint.c
LUFA/Drivers/USB/LowLevel/Endpoint.h
LUFA/Drivers/USB/LowLevel/HostChapter9.c
LUFA/Drivers/USB/LowLevel/Pipe.c
LUFA/Drivers/USB/LowLevel/Pipe.h

index b499a27..a419409 100644 (file)
@@ -246,7 +246,7 @@ TASK(USB_CDC_Host)
                                {\r
                                        /* Get the length of the pipe data, and create a new buffer to hold it */\r
                                        uint16_t BufferLength = Pipe_BytesInPipe();\r
                                {\r
                                        /* Get the length of the pipe data, and create a new buffer to hold it */\r
                                        uint16_t BufferLength = Pipe_BytesInPipe();\r
-                                       uint8_t Buffer[BufferLength];\r
+                                       uint8_t  Buffer[BufferLength];\r
                                        \r
                                        /* Read in the pipe data to the temporary buffer */\r
                                        Pipe_Read_Stream_LE(Buffer, BufferLength);\r
                                        \r
                                        /* Read in the pipe data to the temporary buffer */\r
                                        Pipe_Read_Stream_LE(Buffer, BufferLength);\r
@@ -267,7 +267,7 @@ TASK(USB_CDC_Host)
                        /* Check if a packet has been received */\r
                        if (Pipe_IsINReceived())\r
                        {\r
                        /* Check if a packet has been received */\r
                        if (Pipe_IsINReceived())\r
                        {\r
-                               /* Discard the event notification */\r
+                               /* Discard the unused event notification */\r
                                Pipe_ClearIN();\r
                        }\r
                        \r
                                Pipe_ClearIN();\r
                        }\r
                        \r
index d17c758..303c465 100644 (file)
@@ -17,6 +17,8 @@
   *  - Moved control endpoint interrupt handling into the library itself, enable via the new INTERRUPT_CONTROL_ENDPOINT token\r
   *  - Fixed CDCHost not clearing configured pipes and resetting configured pipes mask when a partially enumerated invalid CDC\r
   *    interface is skipped\r
   *  - Moved control endpoint interrupt handling into the library itself, enable via the new INTERRUPT_CONTROL_ENDPOINT token\r
   *  - Fixed CDCHost not clearing configured pipes and resetting configured pipes mask when a partially enumerated invalid CDC\r
   *    interface is skipped\r
+  *  - Clarified the size of library tokens which accept integer values in the Compile Time Tokens page, values now use the smallest datatype\r
+  *    inside the library that is able to hold their defined value to save space\r
   *\r
   *\r
   *  \section Sec_ChangeLog090510 Version 090510\r
   *\r
   *\r
   *  \section Sec_ChangeLog090510 Version 090510\r
index bb235e1..718fa8f 100644 (file)
  *  <b>HID_STATETABLE_STACK_DEPTH</b> - ( \ref Group_HIDParser ) \n\r
  *  HID reports may contain PUSH and POP elements, to store and retrieve the current HID state table onto a stack. This\r
  *  allows for reports to save the state table before modifying it slightly for a data item, and then restore the previous\r
  *  <b>HID_STATETABLE_STACK_DEPTH</b> - ( \ref Group_HIDParser ) \n\r
  *  HID reports may contain PUSH and POP elements, to store and retrieve the current HID state table onto a stack. This\r
  *  allows for reports to save the state table before modifying it slightly for a data item, and then restore the previous\r
- *  state table in a compact manner. This token may be defined to a non-zero value to give the maximum depth of the state\r
+ *  state table in a compact manner. This token may be defined to a non-zero 8-bit value to give the maximum depth of the state\r
  *  table stack. If not defined, this defaults to the value indicated in the HID.h file documentation.\r
  *\r
  *  <b>HID_USAGE_STACK_DEPTH</b> - ( \ref Group_HIDParser ) \n\r
  *  HID reports generally contain many USAGE elements, which are assigned to INPUT, OUTPUT and FEATURE items in succession\r
  *  when multiple items are defined at once (via REPORT COUNT elements). This allows for several items to be defined with\r
  *  table stack. If not defined, this defaults to the value indicated in the HID.h file documentation.\r
  *\r
  *  <b>HID_USAGE_STACK_DEPTH</b> - ( \ref Group_HIDParser ) \n\r
  *  HID reports generally contain many USAGE elements, which are assigned to INPUT, OUTPUT and FEATURE items in succession\r
  *  when multiple items are defined at once (via REPORT COUNT elements). This allows for several items to be defined with\r
- *  different usages in a compact manner. This token may be defined to a non-zero value to set the maximum depth of the\r
+ *  different usages in a compact manner. This token may be defined to a non-zero 8-bit value to set the maximum depth of the\r
  *  usage stack, indicating the maximum number of USAGE items which can be stored temporarily until the next INPUT, OUTPUT\r
  *  and FEATURE item. If not defined, this defaults to the value indicated in the HID.h file documentation.\r
  *\r
  *  <b>HID_MAX_COLLECTIONS</b> - ( \ref Group_HIDParser ) \n\r
  *  HID reports generally contain several COLLECTION elements, used to group related data items together. Collection information\r
  *  is stored separately in the processed usage structure (and referred to by the data elements in the structure) to save space.\r
  *  usage stack, indicating the maximum number of USAGE items which can be stored temporarily until the next INPUT, OUTPUT\r
  *  and FEATURE item. If not defined, this defaults to the value indicated in the HID.h file documentation.\r
  *\r
  *  <b>HID_MAX_COLLECTIONS</b> - ( \ref Group_HIDParser ) \n\r
  *  HID reports generally contain several COLLECTION elements, used to group related data items together. Collection information\r
  *  is stored separately in the processed usage structure (and referred to by the data elements in the structure) to save space.\r
- *  This token may be defined to a non-zero value to set the maximum number of COLLECTION items which can be processed by the\r
+ *  This token may be defined to a non-zero 8-bit value to set the maximum number of COLLECTION items which can be processed by the\r
  *  parser into the resultant processed report structure. If not defined, this defaults to the value indicated in the HID.h file\r
  *  documentation.\r
  *\r
  *  <b>HID_MAX_REPORTITEMS</b> - ( \ref Group_HIDParser ) \n\r
  *  All HID reports contain one or more INPUT, OUTPUT and/or FEATURE items describing the data which can be sent to and from the HID\r
  *  device. Each item has associated usages, bit offsets in the item reports and other associated data indicating the manner in which\r
  *  parser into the resultant processed report structure. If not defined, this defaults to the value indicated in the HID.h file\r
  *  documentation.\r
  *\r
  *  <b>HID_MAX_REPORTITEMS</b> - ( \ref Group_HIDParser ) \n\r
  *  All HID reports contain one or more INPUT, OUTPUT and/or FEATURE items describing the data which can be sent to and from the HID\r
  *  device. Each item has associated usages, bit offsets in the item reports and other associated data indicating the manner in which\r
- *  the report data should be interpreted by the host. This token may be defined to a non-zero value to set the maximum number of\r
+ *  the report data should be interpreted by the host. This token may be defined to a non-zero 8-bit value to set the maximum number of\r
  *  data elements which can be stored in the processed HID report structure, including INPUT, OUTPUT and (if enabled) FEATURE items.\r
  *  If a item has a multiple count (i.e. a REPORT COUNT of more than 1), each item in the report count is placed separately in the\r
  *  processed HID report table. If not defined, this defaults to the value indicated in the HID.h file documentation.\r
  *  data elements which can be stored in the processed HID report structure, including INPUT, OUTPUT and (if enabled) FEATURE items.\r
  *  If a item has a multiple count (i.e. a REPORT COUNT of more than 1), each item in the report count is placed separately in the\r
  *  processed HID report table. If not defined, this defaults to the value indicated in the HID.h file documentation.\r
  *\r
  *  <b>USB_HOST_TIMEOUT_MS</b> - ( \ref Group_Host ) \n\r
  *  When a control transfer is initiated in host mode to an attached device, a timeout is used to abort the transfer if the attached\r
  *\r
  *  <b>USB_HOST_TIMEOUT_MS</b> - ( \ref Group_Host ) \n\r
  *  When a control transfer is initiated in host mode to an attached device, a timeout is used to abort the transfer if the attached\r
- *  device fails to respond within the timeout period. This token may be defined to a non-zero value to set the timeout period for\r
+ *  device fails to respond within the timeout period. This token may be defined to a non-zero 16-bit value to set the timeout period for\r
  *  control transfers, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.\r
  *\r
  *  <b>HOST_DEVICE_SETTLE_DELAY_MS</b> - ( \ref Group_Host ) \n\r
  *  Some devices require a delay of up to 5 seconds after they are connected to VBUS before the enumeration process can be started, or\r
  *  they will fail to enumerate correctly. By placing a delay before the enumeration process, it can be ensured that the bus has settled\r
  *  control transfers, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.\r
  *\r
  *  <b>HOST_DEVICE_SETTLE_DELAY_MS</b> - ( \ref Group_Host ) \n\r
  *  Some devices require a delay of up to 5 seconds after they are connected to VBUS before the enumeration process can be started, or\r
  *  they will fail to enumerate correctly. By placing a delay before the enumeration process, it can be ensured that the bus has settled\r
- *  back to a known idle state before communications occur with the device. This token may be defined to a non-zero value to set the\r
- *  device settle period, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.\r
+ *  back to a known idle state before communications occur with the device. This token may be defined to a non-zero 16-bit value to set\r
+ *  the device settle period, specified in milliseconds. If not defined, the default value specified in Host.h is used instead.\r
  *\r
  *  <b>USE_STATIC_OPTIONS</b> - ( \ref Group_USBManagement ) \n\r
  *  By default, the USB_Init() function accepts dynamic options at runtime to alter the library behaviour, including whether the USB pad\r
  *\r
  *  <b>USE_STATIC_OPTIONS</b> - ( \ref Group_USBManagement ) \n\r
  *  By default, the USB_Init() function accepts dynamic options at runtime to alter the library behaviour, including whether the USB pad\r
  *\r
  *  <b>USB_STREAM_TIMEOUT_MS</b> - ( \ref Group_USBManagement ) \n\r
  *  When endpoint and/or pipe stream functions are used, by default there is a timeout between each transfer which the connected device or host\r
  *\r
  *  <b>USB_STREAM_TIMEOUT_MS</b> - ( \ref Group_USBManagement ) \n\r
  *  When endpoint and/or pipe stream functions are used, by default there is a timeout between each transfer which the connected device or host\r
- *  must satisfy, or the stream function aborts the remaining data transfer. This token may be defined to a non-zero value to set the timeout\r
+ *  must satisfy, or the stream function aborts the remaining data transfer. This token may be defined to a non-zero 16-bit value to set the timeout\r
  *  period for stream transfers, specified in milliseconds. If not defined, the default value specified in LowLevel.h is used instead.\r
  *\r
  *  <b>NO_LIMITED_CONTROLLER_CONNECT</b> - ( \ref Group_Events ) \n\r
  *  period for stream transfers, specified in milliseconds. If not defined, the default value specified in LowLevel.h is used instead.\r
  *\r
  *  <b>NO_LIMITED_CONTROLLER_CONNECT</b> - ( \ref Group_Events ) \n\r
index 7883830..59e3a4b 100644 (file)
@@ -114,13 +114,13 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
          USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);\r
 }\r
                        \r
          USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);\r
 }\r
                        \r
-uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine)\r
+uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine)\r
 {\r
        uint8_t ErrorCode;\r
                \r
        while (*BytesRem)\r
        {\r
 {\r
        uint8_t ErrorCode;\r
                \r
        while (*BytesRem)\r
        {\r
-               uint8_t*  PrevDescLoc = *CurrConfigLoc;\r
+               uint8_t*  PrevDescLoc  = *CurrConfigLoc;\r
                uint16_t  PrevBytesRem = *BytesRem;\r
 \r
                USB_GetNextDescriptor(BytesRem, CurrConfigLoc);\r
                uint16_t  PrevBytesRem = *BytesRem;\r
 \r
                USB_GetNextDescriptor(BytesRem, CurrConfigLoc);\r
index 6f5bbc4..74d6d27 100644 (file)
                                *BytesRem      -= CurrDescriptorSize;\r
                        }\r
                        \r
                                *BytesRem      -= CurrDescriptorSize;\r
                        }\r
                        \r
-       /* Private Interface - For use in library only: */\r
-       #if !defined(__DOXYGEN__)\r
                /* Type Defines: */\r
                /* Type Defines: */\r
-                       typedef uint8_t (* const ComparatorPtr_t)(void* const);\r
+                       /** Type define for a Configuration Descriptor comparator function (function taking a pointer to an array\r
+                        *  of type void, returning a uint8_t value).\r
+                        *\r
+                        *  \see \ref USB_GetNextDescriptorComp function for more details\r
+                        */\r
+                       typedef uint8_t (* const ConfigComparatorPtr_t)(void* const);\r
 \r
 \r
+       /* Private Interface - For use in library only: */\r
+       #if !defined(__DOXYGEN__)\r
                /* Function Prototypes: */\r
                /* Function Prototypes: */\r
-                       uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ComparatorPtr_t ComparatorRoutine);\r
+                       uint8_t USB_GetNextDescriptorComp_Prv(uint16_t* BytesRem, uint8_t** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine);\r
        #endif\r
                        \r
        /* Disable C linkage for C++ Compilers: */\r
        #endif\r
                        \r
        /* Disable C linkage for C++ Compilers: */\r
index 6a18920..e739d84 100644 (file)
                                STREAMCALLBACK_Continue            = 0, /**< Continue sending or receiving the stream. */\r
                                STREAMCALLBACK_Abort               = 1, /**< Abort the stream send or receiving process. */\r
                        };\r
                                STREAMCALLBACK_Continue            = 0, /**< Continue sending or receiving the stream. */\r
                                STREAMCALLBACK_Abort               = 1, /**< Abort the stream send or receiving process. */\r
                        };\r
-                       \r
+\r
+               /* Type Defines: */\r
+                       /** Type define for a Stream Callback function (function taking no arguments and retuning a\r
+                        *  uint8_t value).\r
+                        *\r
+                        *  \see \ref STREAM_CALLBACK macro for more details\r
+                        */\r
+                       typedef uint8_t (* const StreamCallbackPtr_t)(void);\r
+               \r
 #endif\r
 \r
 /** @} */\r
 #endif\r
 \r
 /** @} */\r
index bd264b1..099022c 100644 (file)
@@ -74,7 +74,11 @@ void Endpoint_ClearEndpoints(void)
 #if !defined(CONTROL_ONLY_DEVICE)\r
 uint8_t Endpoint_WaitUntilReady(void)\r
 {\r
 #if !defined(CONTROL_ONLY_DEVICE)\r
 uint8_t Endpoint_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
+       #endif\r
 \r
        USB_INT_Clear(USB_INT_SOFI);\r
 \r
 \r
        USB_INT_Clear(USB_INT_SOFI);\r
 \r
@@ -108,7 +112,7 @@ uint8_t Endpoint_WaitUntilReady(void)
 \r
 uint8_t Endpoint_Discard_Stream(uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\r
 \r
 uint8_t Endpoint_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
@@ -143,7 +147,7 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
 \r
 uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\r
 \r
 uint8_t Endpoint_Write_Stream_LE(const 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
@@ -179,7 +183,7 @@ uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length
 \r
 uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\r
 \r
 uint8_t Endpoint_Write_Stream_BE(const 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
@@ -215,7 +219,7 @@ uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length
 \r
 uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\r
 \r
 uint8_t Endpoint_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
@@ -251,7 +255,7 @@ uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length
 \r
 uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\r
 \r
 uint8_t Endpoint_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
index 9a553d3..7f2b76a 100644 (file)
                         */\r
                        uint8_t Endpoint_Discard_Stream(uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Endpoint_Discard_Stream(uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                       , uint8_t (* const Callback)(void)\r
+                                                       , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                        );\r
 \r
                        #endif\r
                                                        );\r
 \r
                         */\r
                        uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Endpoint_Write_Stream_LE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                        , uint8_t (* const Callback)(void)\r
+                                                        , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                         ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        #endif\r
                                                         ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                         */\r
                        uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Endpoint_Write_Stream_BE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                        , uint8_t (* const Callback)(void)\r
+                                                        , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                         ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        #endif\r
                                                         ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                         */\r
                        uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Endpoint_Read_Stream_LE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                       , uint8_t (* const Callback)(void)\r
+                                                       , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                        ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        #endif\r
                                                        ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                         */\r
                        uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Endpoint_Read_Stream_BE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                       , uint8_t (* const Callback)(void)\r
+                                                       , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                        ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        #endif\r
                                                        ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
index 4b96c69..238e099 100644 (file)
@@ -153,7 +153,11 @@ End_Of_Control_Send:
 \r
 static uint8_t USB_Host_Wait_For_Setup_IOS(const uint8_t WaitType)\r
 {\r
 \r
 static uint8_t USB_Host_Wait_For_Setup_IOS(const uint8_t WaitType)\r
 {\r
+       #if (USB_HOST_TIMEOUT_MS < 0xFF)\r
+       uint8_t  TimeoutCounter = USB_HOST_TIMEOUT_MS;  \r
+       #else\r
        uint16_t TimeoutCounter = USB_HOST_TIMEOUT_MS;\r
        uint16_t TimeoutCounter = USB_HOST_TIMEOUT_MS;\r
+       #endif\r
        \r
        while (!(((WaitType == USB_HOST_WAITFOR_SetupSent)  && Pipe_IsSETUPSent())  ||\r
                 ((WaitType == USB_HOST_WAITFOR_InReceived) && Pipe_IsINReceived()) ||\r
        \r
        while (!(((WaitType == USB_HOST_WAITFOR_SetupSent)  && Pipe_IsSETUPSent())  ||\r
                 ((WaitType == USB_HOST_WAITFOR_InReceived) && Pipe_IsINReceived()) ||\r
index c81ee64..71a33d6 100644 (file)
@@ -70,7 +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
+       #endif\r
 \r
        USB_INT_Clear(USB_INT_HSOFI);\r
 \r
 \r
        USB_INT_Clear(USB_INT_HSOFI);\r
 \r
@@ -104,7 +108,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
@@ -140,7 +144,7 @@ uint8_t Pipe_Write_Stream_LE(const void* Data, uint16_t Length
 \r
 uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\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
@@ -176,7 +180,7 @@ uint8_t Pipe_Write_Stream_BE(const void* Data, uint16_t Length
 \r
 uint8_t Pipe_Discard_Stream(uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\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
@@ -211,7 +215,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
 \r
 uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\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
@@ -247,7 +251,7 @@ uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length
 \r
 uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length\r
 #if !defined(NO_STREAM_CALLBACKS)\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
index 796b4c5..c96a440 100644 (file)
                         */\r
                        uint8_t Pipe_Write_Stream_LE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Pipe_Write_Stream_LE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                    , uint8_t (* const Callback)(void)\r
+                                                    , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                     ) ATTR_NON_NULL_PTR_ARG(1);                                \r
 \r
                        #endif\r
                                                     ) ATTR_NON_NULL_PTR_ARG(1);                                \r
 \r
                         */\r
                        uint8_t Pipe_Write_Stream_BE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Pipe_Write_Stream_BE(const void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                    , uint8_t (* const Callback)(void)\r
+                                                    , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                     ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        #endif\r
                                                     ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                         */\r
                        uint8_t Pipe_Discard_Stream(uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Pipe_Discard_Stream(uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                   , uint8_t (* const Callback)(void)\r
+                                                   , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                    );\r
 \r
                        #endif\r
                                                    );\r
 \r
                         */\r
                        uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Pipe_Read_Stream_LE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                   , uint8_t (* const Callback)(void)\r
+                                                   , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                    ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                        #endif\r
                                                    ) ATTR_NON_NULL_PTR_ARG(1);\r
 \r
                         */\r
                        uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
                         */\r
                        uint8_t Pipe_Read_Stream_BE(void* Buffer, uint16_t Length\r
                        #if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)\r
-                                                   , uint8_t (* const Callback)(void)\r
+                                                   , StreamCallbackPtr_t Callback\r
                        #endif\r
                                                    ) ATTR_NON_NULL_PTR_ARG(1);\r
                        \r
                        #endif\r
                                                    ) ATTR_NON_NULL_PTR_ARG(1);\r
                        \r