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.
$(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c \\r
$(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c \\r
$(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c \\r
- $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c \\r
\r
\r
# List C++ source files here. (C dependencies are automatically generated.)\r
$(LUFA_PATH)/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c \\r
$(LUFA_PATH)/LUFA/Drivers/USB/Class/Device/HID.c \\r
$(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HID.c \\r
- $(LUFA_PATH)/LUFA/Drivers/USB/Class/Host/HIDParser.c \\r
\r
\r
# List C++ source files here. (C dependencies are automatically generated.)\r
#define HID_BOOT_KEYBOARD_PROTOCOL 0x01\r
\r
/* Type Defines: */\r
+ /** Enum for the different types of HID reports. */\r
+ enum HID_ReportItemTypes_t\r
+ {\r
+ REPORT_ITEM_TYPE_In = 1, /**< Indicates that the item is an IN report type. */\r
+ REPORT_ITEM_TYPE_Out = 2, /**< Indicates that the item is an OUT report type. */\r
+ REPORT_ITEM_TYPE_Feature = 3, /**< Indicates that the item is a FEATURE report type. */\r
+ };\r
+\r
/** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID\r
* specification for details on the structure elements.\r
*/\r
}\r
\r
MS_Device_ReturnCommandStatus(MSInterfaceInfo);\r
- \r
- if (MSInterfaceInfo->State.IsMassStoreReset)\r
- {\r
- Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataOUTEndpointNumber);\r
- Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataINEndpointNumber);\r
- \r
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);\r
- Endpoint_ClearStall();\r
- Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);\r
- Endpoint_ClearStall();\r
- }\r
}\r
}\r
\r
- MSInterfaceInfo->State.IsMassStoreReset = false;\r
+ if (MSInterfaceInfo->State.IsMassStoreReset)\r
+ {\r
+ Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataOUTEndpointNumber);\r
+ Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataINEndpointNumber);\r
+ \r
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber);\r
+ Endpoint_ClearStall();\r
+ Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber);\r
+ Endpoint_ClearStall();\r
+\r
+ MSInterfaceInfo->State.IsMassStoreReset = false;\r
+ }\r
}\r
\r
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
StreamCallback_MS_Device_AbortOnMassStoreReset);\r
\r
Endpoint_ClearOUT();\r
- \r
- if (MSInterfaceInfo->State.IsMassStoreReset)\r
- return false;\r
-\r
- return true;\r
+ \r
+ return !(MSInterfaceInfo->State.IsMassStoreReset);\r
}\r
\r
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
{\r
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),\r
.bRequest = REQ_SetReport,\r
- .wValue = ReportID,\r
+ .wValue = (REPORT_ITEM_TYPE_In << 8) | ReportID,\r
.wIndex = HIDInterfaceInfo->State.InterfaceNumber,\r
.wLength = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In),\r
};\r
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),\r
.bRequest = REQ_SetReport,\r
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)\r
- .wValue = ReportID,\r
+ .wValue = (REPORT_ITEM_TYPE_Out << 8) | ReportID,\r
#else\r
.wValue = 0,\r
#endif\r
\r
\r
/** Receives a HID IN report from the attached HID device, when a report has been received on the HID IN Data pipe.\r
+ * \r
+ * \note The destination buffer should be large enough to accomodate the largest report that the attached device\r
+ * can generate.\r
*\r
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class host configuration and state\r
* \param[in] Buffer Buffer to store the received report into\r
uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, void* Buffer) ATTR_NON_NULL_PTR_ARG(1, 2);\r
\r
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)\r
- /** Received a HID IN report from the attached device, by the report ID.\r
+ /** Receives a HID IN report from the attached device, by the report ID.\r
*\r
* \note When the HID_HOST_BOOT_PROTOCOL_ONLY compile time token is defined, this method is unavailable.\r
*\r
#include <stdbool.h>\r
\r
#include "HIDReportData.h"\r
+ #include "../Common/HID.h"\r
\r
#include "../../../../Common/Common.h"\r
\r
#endif\r
\r
/* Public Interface - May be used in end-application: */\r
- /* Enums: */\r
- /** Enum for indicating what type of report item an entry in a \ref HID_ReportInfo_t ReportItem array is */\r
- enum HID_ReportItemTypes_t\r
- {\r
- REPORT_ITEM_TYPE_In = 0, /**< Indicates that the item is an IN report type. */\r
- REPORT_ITEM_TYPE_Out = 1, /**< Indicates that the item is an OUT report type. */\r
- REPORT_ITEM_TYPE_Feature = 2, /**< Indicates that the item is a FEATURE report type. */\r
- };\r
- \r
+ /* Enums: */ \r
/** Enum for the possible error codes in the return value of the \ref USB_ProcessHIDReport() function */\r
enum HID_Parse_ErrorCodes_t\r
{\r
* - Fixed HID device class driver not reselecting the correct endpoint once the user callback routines have been called\r
* - Corrected HID descriptor in the Joystick Device demos - buttons should be placed outside the pointer collection\r
* - Fixed HID report parser collection paths invalid due to misplaced semicolon in the free path item search loop\r
+ * - Fixed HID host Class driver report send/receive report broken when issued through the control pipe\r
*\r
* \section Sec_ChangeLog090924 Version 090924\r
*\r
* - Add unit testing to APIs\r
* - Add board overviews\r
* - Add resume interrupt support\r
- * - Specification compliance testing for all device demos\r
+ * - Correct mishandling of error cases in Mass Storage demo\r
* - Add RNDIS Host Class driver\r
* - Make new demos\r
* -# Keyboard/Mouse Dual Class Host\r