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
}\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
\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
\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
\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
\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
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
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
\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
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
}\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
}\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
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
/* 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
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
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
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