aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-09 08:24:01 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-09 08:24:01 +0000
commit8bb007f80b3e275c9857a5ffa2cf597711fb7478 (patch)
treef574668e4d5e1d80974b21d92b2695438b45d83d /LUFA/Drivers/USB/Class/Host
parent4dde844e9f12bca880f88f952231a614d5d912ad (diff)
downloadlufa-8bb007f80b3e275c9857a5ffa2cf597711fb7478.tar.gz
lufa-8bb007f80b3e275c9857a5ffa2cf597711fb7478.tar.bz2
lufa-8bb007f80b3e275c9857a5ffa2cf597711fb7478.zip
Fixed HID host Class driver report send/receive report broken when issued through the control pipe.
Make Mass Storage device Class driver accept resets at any time, rather than just after a command block has been processed. Remove the HID device parser from the boot protocol Keyboard/Mouse demos.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.c4
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.h5
-rw-r--r--LUFA/Drivers/USB/Class/Host/HIDParser.h11
3 files changed, 8 insertions, 12 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c
index 7d9b3b559..a82fe537f 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.c
+++ b/LUFA/Drivers/USB/Class/Host/HID.c
@@ -162,7 +162,7 @@ uint8_t HID_Host_ReceiveReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceI
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetReport,
- .wValue = ReportID,
+ .wValue = (REPORT_ITEM_TYPE_In << 8) | ReportID,
.wIndex = HIDInterfaceInfo->State.InterfaceNumber,
.wLength = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In),
};
@@ -249,7 +249,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),
.bRequest = REQ_SetReport,
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
- .wValue = ReportID,
+ .wValue = (REPORT_ITEM_TYPE_Out << 8) | ReportID,
#else
.wValue = 0,
#endif
diff --git a/LUFA/Drivers/USB/Class/Host/HID.h b/LUFA/Drivers/USB/Class/Host/HID.h
index 89cb3d860..8a70f27b3 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.h
+++ b/LUFA/Drivers/USB/Class/Host/HID.h
@@ -158,6 +158,9 @@
/** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.
+ *
+ * \note The destination buffer should be large enough to accomodate the largest report that the attached device
+ * can generate.
*
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state
* \param[in] Buffer Buffer to store the received report into
@@ -167,7 +170,7 @@
uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, void* Buffer) ATTR_NON_NULL_PTR_ARG(1, 2);
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
- /** Received a HID IN report from the attached device, by the report ID.
+ /** Receives a HID IN report from the attached device, by the report ID.
*
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.
*
diff --git a/LUFA/Drivers/USB/Class/Host/HIDParser.h b/LUFA/Drivers/USB/Class/Host/HIDParser.h
index 751e40e0e..d7ef272d3 100644
--- a/LUFA/Drivers/USB/Class/Host/HIDParser.h
+++ b/LUFA/Drivers/USB/Class/Host/HIDParser.h
@@ -62,6 +62,7 @@
#include <stdbool.h>
#include "HIDReportData.h"
+ #include "../Common/HID.h"
#include "../../../../Common/Common.h"
@@ -124,15 +125,7 @@
#endif
/* Public Interface - May be used in end-application: */
- /* Enums: */
- /** Enum for indicating what type of report item an entry in a \ref HID_ReportInfo_t ReportItem array is */
- enum HID_ReportItemTypes_t
- {
- REPORT_ITEM_TYPE_In = 0, /**< Indicates that the item is an IN report type. */
- REPORT_ITEM_TYPE_Out = 1, /**< Indicates that the item is an OUT report type. */
- REPORT_ITEM_TYPE_Feature = 2, /**< Indicates that the item is a FEATURE report type. */
- };
-
+ /* Enums: */
/** Enum for the possible error codes in the return value of the \ref USB_ProcessHIDReport() function */
enum HID_Parse_ErrorCodes_t
{