diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-09 08:24:01 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-11-09 08:24:01 +0000 |
commit | 8bb007f80b3e275c9857a5ffa2cf597711fb7478 (patch) | |
tree | f574668e4d5e1d80974b21d92b2695438b45d83d /LUFA/Drivers/USB/Class/Device/MassStorage.c | |
parent | 4dde844e9f12bca880f88f952231a614d5d912ad (diff) | |
download | lufa-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/Device/MassStorage.c')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/MassStorage.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/MassStorage.c b/LUFA/Drivers/USB/Class/Device/MassStorage.c index fce864386..43dc3f82b 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)
|