Optimized Endpoint_Read_Word_* and Pipe_Read_Word_* macros to reduce compiled size.
[pub/USBasp.git] / Demos / Host / LowLevel / CDCHost / ConfigDescriptor.c
index baf02a2..f1a57cd 100644 (file)
@@ -52,7 +52,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        uint8_t  FoundEndpoints = 0;\r
        \r
        /* Get Configuration Descriptor size from the device */\r
-       if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
+       if (USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
          return ControlError;\r
        \r
        /* Ensure that the Configuration Descriptor isn't too large */\r
@@ -63,7 +63,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        ConfigDescriptorData = alloca(ConfigDescriptorSize);\r
 \r
        /* Retrieve the entire configuration descriptor into the allocated buffer */\r
-       USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);\r
+       USB_GetDeviceConfigDescriptor(1, &ConfigDescriptorSize, ConfigDescriptorData);\r
        \r
        /* Validate returned data - ensure first entry is a configuration header descriptor */\r
        if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)\r
@@ -138,7 +138,6 @@ uint8_t ProcessConfigurationDescriptor(void)
                                Pipe_ConfigurePipe(CDC_NOTIFICATIONPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
                                                                   EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);\r
 \r
-                               Pipe_SetInfiniteINRequests();\r
                                Pipe_SetInterruptPeriod(EndpointData->PollingIntervalMS);\r
                                \r
                                /* Set the flag indicating that the notification pipe has been found */\r
@@ -153,9 +152,6 @@ uint8_t ProcessConfigurationDescriptor(void)
                                /* Configure the data IN pipe */\r
                                Pipe_ConfigurePipe(CDC_DATAPIPE_IN, EP_TYPE_BULK, PIPE_TOKEN_IN,\r
                                                                   EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);\r
-\r
-                               Pipe_SetInfiniteINRequests();\r
-                               Pipe_Unfreeze();\r
                                \r
                                /* Set the flag indicating that the data IN pipe has been found */\r
                                FoundEndpoints |= (1 << CDC_DATAPIPE_IN);\r
@@ -166,8 +162,6 @@ uint8_t ProcessConfigurationDescriptor(void)
                                Pipe_ConfigurePipe(CDC_DATAPIPE_OUT, EP_TYPE_BULK, PIPE_TOKEN_OUT,\r
                                                                   EndpointData->EndpointAddress, EndpointData->EndpointSize, PIPE_BANK_SINGLE);\r
                                \r
-                               Pipe_Unfreeze();\r
-                               \r
                                /* Set the flag indicating that the data OUT pipe has been found */\r
                                FoundEndpoints |= (1 << CDC_DATAPIPE_OUT);\r
                        }\r