From 8bb007f80b3e275c9857a5ffa2cf597711fb7478 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 9 Nov 2009 08:24:01 +0000 Subject: 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. --- LUFA/Drivers/USB/Class/Device/MassStorage.c | 31 +++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'LUFA/Drivers/USB/Class/Device') diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c index fce8643864..43dc3f82b4 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorage.c +++ b/LUFA/Drivers/USB/Class/Device/MassStorage.c @@ -120,21 +120,21 @@ void MS_Device_USBTask(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) } MS_Device_ReturnCommandStatus(MSInterfaceInfo); - - if (MSInterfaceInfo->State.IsMassStoreReset) - { - Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataOUTEndpointNumber); - Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataINEndpointNumber); - - Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber); - Endpoint_ClearStall(); - Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber); - Endpoint_ClearStall(); - } } } - MSInterfaceInfo->State.IsMassStoreReset = false; + if (MSInterfaceInfo->State.IsMassStoreReset) + { + Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataOUTEndpointNumber); + Endpoint_ResetFIFO(MSInterfaceInfo->Config.DataINEndpointNumber); + + Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber); + Endpoint_ClearStall(); + Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataINEndpointNumber); + Endpoint_ClearStall(); + + MSInterfaceInfo->State.IsMassStoreReset = false; + } } static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) @@ -165,11 +165,8 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte StreamCallback_MS_Device_AbortOnMassStoreReset); Endpoint_ClearOUT(); - - if (MSInterfaceInfo->State.IsMassStoreReset) - return false; - - return true; + + return !(MSInterfaceInfo->State.IsMassStoreReset); } static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo) -- cgit v1.2.3