Oops - with new changes to the way the device Configuration Descriptor is retrieved...
authorDean Camera <dean@fourwalledcubicle.com>
Mon, 31 Aug 2009 08:27:48 +0000 (08:27 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Mon, 31 Aug 2009 08:27:48 +0000 (08:27 +0000)
12 files changed:
Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c
Demos/Host/LowLevel/CDCHost/ConfigDescriptor.c
Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c
Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c
Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c
Demos/Host/LowLevel/KeyboardHostWithParser/KeyboardHostWithParser.c
Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c
Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c
Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c
Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c
Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c

index f856262..487cac6 100644 (file)
@@ -70,7 +70,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                        return NoEndpointFound;\r
                }\r
                \r
                        return NoEndpointFound;\r
                }\r
                \r
-               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
                /* Check if the endpoint is a bulk or interrupt type endpoint */\r
                if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)\r
 \r
                /* Check if the endpoint is a bulk or interrupt type endpoint */\r
                if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)\r
index f9671e2..917df27 100644 (file)
@@ -122,7 +122,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                        }\r
                }\r
                \r
                        }\r
                }\r
                \r
-               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
                /* Check if the found endpoint is a interrupt or bulk type descriptor */\r
                if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)\r
 \r
                /* Check if the found endpoint is a interrupt or bulk type descriptor */\r
                if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)\r
index dba62fd..6730fdb 100644 (file)
@@ -89,7 +89,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                }\r
                \r
                /* Retrieve the endpoint address from the endpoint descriptor */\r
                }\r
                \r
                /* Retrieve the endpoint address from the endpoint descriptor */\r
-               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
                /* If the endpoint is a IN type endpoint */\r
                if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
 \r
                /* If the endpoint is a IN type endpoint */\r
                if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
index 46fb94e..7dc5574 100644 (file)
@@ -81,7 +81,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
-       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
        /* Configure the keyboard data pipe */\r
        Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
 \r
        /* Configure the keyboard data pipe */\r
        Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
index 7ab0a18..d09e4c4 100644 (file)
@@ -81,7 +81,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        }\r
 \r
        /* Save the HID report size for later use */\r
        }\r
 \r
        /* Save the HID report size for later use */\r
-       HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;\r
+       HIDReportSize = DESCRIPTOR_CAST(CurrConfigLocation, USB_Descriptor_HID_t).HIDReportLength;\r
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,\r
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,\r
@@ -92,7 +92,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
-       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
        /* Configure the keyboard data pipe */\r
        Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
 \r
        /* Configure the keyboard data pipe */\r
        Pipe_ConfigurePipe(KEYBOARD_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
index db4032f..3c9f304 100644 (file)
@@ -166,8 +166,8 @@ void Keyboard_HID_Task(void)
                                break;\r
                        }\r
                                \r
                                break;\r
                        }\r
                                \r
-                       puts_P(PSTR("Processing HID Report.\r\n"));\r
-\r
+                       printf_P(PSTR("Processing HID Report (Size %d Bytes).\r\n"), HIDReportSize);\r
+                                               \r
                        /* Get and process the device's first HID report descriptor */\r
                        if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)\r
                        {\r
                        /* Get and process the device's first HID report descriptor */\r
                        if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)\r
                        {\r
index 1ba3244..ca84e45 100644 (file)
@@ -84,7 +84,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                        return NoEndpointFound;\r
                }\r
                \r
                        return NoEndpointFound;\r
                }\r
                \r
-               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
                /* Check if the endpoint is a bulk IN or bulk OUT endpoint, set appropriate globals */\r
                if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
 \r
                /* Check if the endpoint is a bulk IN or bulk OUT endpoint, set appropriate globals */\r
                if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
index 912f146..2e6a4c8 100644 (file)
@@ -81,7 +81,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
-       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
        /* Configure the mouse data pipe */\r
        Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
 \r
        /* Configure the mouse data pipe */\r
        Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
index fa06741..901119e 100644 (file)
@@ -63,7 +63,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                default:\r
                        return ControlError;\r
        }\r
                default:\r
                        return ControlError;\r
        }\r
-       \r
+\r
        /* Get the mouse interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,\r
                                      DComp_NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        /* Get the mouse interface from the configuration descriptor */\r
        if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,\r
                                      DComp_NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
@@ -81,8 +81,8 @@ uint8_t ProcessConfigurationDescriptor(void)
        }\r
 \r
        /* Save the HID report size for later use */\r
        }\r
 \r
        /* Save the HID report size for later use */\r
-       HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;\r
-\r
+       HIDReportSize = DESCRIPTOR_CAST(CurrConfigLocation, USB_Descriptor_HID_t).HIDReportLength;\r
+       \r
        /* Get the mouse interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,\r
                                      DComp_NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        /* Get the mouse interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation,\r
                                      DComp_NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
@@ -92,7 +92,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
        }\r
        \r
        /* Retrieve the endpoint address from the endpoint descriptor */\r
-       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+       USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
        /* Configure the mouse data pipe */\r
        Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
 \r
        /* Configure the mouse data pipe */\r
        Pipe_ConfigurePipe(MOUSE_DATAPIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN,\r
index 31820be..69ba64b 100644 (file)
@@ -166,7 +166,7 @@ void Mouse_HID_Task(void)
                                break;\r
                        }\r
                        \r
                                break;\r
                        }\r
                        \r
-                       puts_P(PSTR("Processing HID Report.\r\n"));\r
+                       printf_P(PSTR("Processing HID Report (Size %d Bytes).\r\n"), HIDReportSize);\r
 \r
                        /* Get and process the device's first HID report descriptor */\r
                        if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)\r
 \r
                        /* Get and process the device's first HID report descriptor */\r
                        if ((ErrorCode = GetHIDReportData()) != ParseSuccessful)\r
@@ -179,7 +179,7 @@ void Mouse_HID_Task(void)
                                \r
                                /* Wait until USB device disconnected */\r
                                USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
                                \r
                                /* Wait until USB device disconnected */\r
                                USB_HostState = HOST_STATE_WaitForDeviceRemoval;\r
-                               break;                  \r
+                               break;\r
                        }\r
 \r
                        puts_P(PSTR("Mouse Enumerated.\r\n"));\r
                        }\r
 \r
                        puts_P(PSTR("Mouse Enumerated.\r\n"));\r
index 22d84c5..5a8731d 100644 (file)
@@ -61,8 +61,8 @@ uint8_t ProcessConfigurationDescriptor(void)
                return NoInterfaceFound;\r
        }\r
        \r
                return NoInterfaceFound;\r
        }\r
        \r
-       PrinterInterfaceNumber = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).InterfaceNumber;\r
-       PrinterAltSetting      = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_Interface_t).AlternateSetting;\r
+       PrinterInterfaceNumber = DESCRIPTOR_CAST(CurrConfigLocation, USB_Descriptor_Interface_t).InterfaceNumber;\r
+       PrinterAltSetting      = DESCRIPTOR_CAST(CurrConfigLocation, USB_Descriptor_Interface_t).AlternateSetting;\r
 \r
        /* Get the IN and OUT data endpoints for the printer interface */\r
        while (FoundEndpoints != ((1 << PRINTER_DATA_OUT_PIPE) | (1 << PRINTER_DATA_IN_PIPE)))\r
 \r
        /* Get the IN and OUT data endpoints for the printer interface */\r
        while (FoundEndpoints != ((1 << PRINTER_DATA_OUT_PIPE) | (1 << PRINTER_DATA_IN_PIPE)))\r
@@ -74,7 +74,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                        return NoEndpointFound;\r
                }\r
                \r
                        return NoEndpointFound;\r
                }\r
                \r
-               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
                /* Check if the endpoint is a bulk IN or bulk OUT endpoint, set appropriate globals */\r
                if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
 \r
                /* Check if the endpoint is a bulk IN or bulk OUT endpoint, set appropriate globals */\r
                if (EndpointData->EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
index 4e7751d..5b3664f 100644 (file)
@@ -84,7 +84,7 @@ uint8_t ProcessConfigurationDescriptor(void)
                        return NoEndpointFound;\r
                }\r
                \r
                        return NoEndpointFound;\r
                }\r
                \r
-               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Endpoint_t);\r
+               USB_Descriptor_Endpoint_t* EndpointData = DESCRIPTOR_PCAST(CurrConfigLocation, USB_Descriptor_Endpoint_t);\r
 \r
                /* Check if the found endpoint is a interrupt or bulk type descriptor */\r
                if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)\r
 \r
                /* Check if the found endpoint is a interrupt or bulk type descriptor */\r
                if ((EndpointData->Attributes & EP_TYPE_MASK) == EP_TYPE_INTERRUPT)\r