aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/HID.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-07-11 10:44:34 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-07-11 10:44:34 +0000
commitc029d72b9497ebf554c9d05ec58d48d7534b8a2f (patch)
treee01233cfe945e7faf788d4f6abeef773f06149dd /LUFA/Drivers/USB/Class/Host/HID.c
parent85e85befc41a9a66a49db0afd08e04c88ba38556 (diff)
downloadlufa-c029d72b9497ebf554c9d05ec58d48d7534b8a2f.tar.gz
lufa-c029d72b9497ebf554c9d05ec58d48d7534b8a2f.tar.bz2
lufa-c029d72b9497ebf554c9d05ec58d48d7534b8a2f.zip
More endianness porting of the LUFA host mode class drivers.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/HID.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c
index 94d09f356..08fb66677 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.c
+++ b/LUFA/Drivers/USB/Class/Host/HID.c
@@ -105,7 +105,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
if (PipeNum == HIDInterfaceInfo->Config.DataINPipeNumber)
{
- Size = DataINEndpoint->EndpointSize;
+ Size = le16_to_cpu(DataINEndpoint->EndpointSize);
EndpointAddress = DataINEndpoint->EndpointAddress;
Token = PIPE_TOKEN_IN;
Type = EP_TYPE_INTERRUPT;
@@ -119,7 +119,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
if (DataOUTEndpoint == NULL)
continue;
- Size = DataOUTEndpoint->EndpointSize;
+ Size = le16_to_cpu(DataOUTEndpoint->EndpointSize);
EndpointAddress = DataOUTEndpoint->EndpointAddress;
Token = PIPE_TOKEN_OUT;
Type = EP_TYPE_INTERRUPT;
@@ -145,7 +145,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
}
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
- HIDInterfaceInfo->State.HIDReportSize = HIDDescriptor->HIDReportLength;
+ HIDInterfaceInfo->State.HIDReportSize = LE16_TO_CPU(HIDDescriptor->HIDReportLength);
HIDInterfaceInfo->State.SupportsBootProtocol = (HIDInterface->SubClass != HID_CSCP_NonBootProtocol);
HIDInterfaceInfo->State.LargestReportSize = 8;
HIDInterfaceInfo->State.IsActive = true;
@@ -334,6 +334,9 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
{
uint8_t ErrorCode;
+ if (!(HIDInterfaceInfo->State.SupportsBootProtocol))
+ return HID_ERROR_LOGICAL;
+
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
@@ -345,9 +348,6 @@ uint8_t HID_Host_SetBootProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceInf
Pipe_SelectPipe(PIPE_CONTROLPIPE);
- if (!(HIDInterfaceInfo->State.SupportsBootProtocol))
- return HID_ERROR_LOGICAL;
-
if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful)
return ErrorCode;