Added Doxygen documentation to the Audio class driver. Added new modules for each...
[pub/USBasp.git] / Demos / Host / KeyboardHostWithParser / ConfigDescriptor.c
index 9b56823..4ee3b99 100644 (file)
@@ -49,7 +49,6 @@ uint8_t ProcessConfigurationDescriptor(void)
 {\r
        uint8_t* ConfigDescriptorData;\r
        uint16_t ConfigDescriptorSize;\r
-       uint8_t  ErrorCode;\r
        \r
        /* Get Configuration Descriptor size from the device */\r
        if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
@@ -70,14 +69,16 @@ uint8_t ProcessConfigurationDescriptor(void)
          return InvalidConfigDataReturned;\r
        \r
        /* Get the keyboard interface from the configuration descriptor */\r
-       if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface)))\r
+       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
+                                     DComp_NextKeyboardInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
        }\r
        \r
        /* Get the keyboard interface's HID descriptor */\r
-       if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHID)))\r
+       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
+                                     DComp_NextHID) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDDescriptorFound;\r
@@ -87,8 +88,8 @@ uint8_t ProcessConfigurationDescriptor(void)
        HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;\r
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
-       if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                                       NextInterfaceKeyboardDataEndpoint)))\r
+       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
+                                     DComp_NextInterfaceKeyboardDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
@@ -115,7 +116,7 @@ uint8_t ProcessConfigurationDescriptor(void)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextKeyboardInterface)\r
+uint8_t DComp_NextKeyboardInterface(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
@@ -139,7 +140,7 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)\r
+uint8_t DComp_NextInterfaceKeyboardDataEndpoint(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
@@ -162,7 +163,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
  *\r
  *  \return A value from the DSEARCH_Return_ErrorCodes_t enum\r
  */\r
-DESCRIPTOR_COMPARATOR(NextHID)\r
+uint8_t DComp_NextHID(void* CurrentDescriptor)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
          return DESCRIPTOR_SEARCH_Found;\r