aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/MassStorage
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-03-10 05:56:17 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-03-10 05:56:17 +0000
commit38039765346c7441208dbcb3fd3cf8f13b7ced58 (patch)
treeaafe05db569ec7a2938b3e7cdbd63e4a5d6a054e /Demos/MassStorage
parent4a09da20989dfe0c41dc1272fa6dce1e11539c15 (diff)
downloadlufa-38039765346c7441208dbcb3fd3cf8f13b7ced58.tar.gz
lufa-38039765346c7441208dbcb3fd3cf8f13b7ced58.tar.bz2
lufa-38039765346c7441208dbcb3fd3cf8f13b7ced58.zip
Fixed incorrect/missing control status stage transfers on demos, bootloaders and applications (thanks to Nate Lawson).
Diffstat (limited to 'Demos/MassStorage')
-rw-r--r--Demos/MassStorage/MassStorage.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/Demos/MassStorage/MassStorage.c b/Demos/MassStorage/MassStorage.c
index 34fcee488..92e33073c 100644
--- a/Demos/MassStorage/MassStorage.c
+++ b/Demos/MassStorage/MassStorage.c
@@ -159,10 +159,13 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
case REQ_MassStorageReset:
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
- /* Indicate that the current transfer should be aborted */
- IsMassStoreReset = true;
-
Endpoint_ClearSetupReceived();
+
+ /* Indicate that the current transfer should be aborted */
+ IsMassStoreReset = true;
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupINReady()));
Endpoint_ClearSetupIN();
}
@@ -171,9 +174,15 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
- Endpoint_ClearSetupReceived();
+ Endpoint_ClearSetupReceived();
+
Endpoint_Write_Byte(TOTAL_LUNS - 1);
+
Endpoint_ClearSetupIN();
+
+ /* Acknowledge status stage */
+ while (!(Endpoint_IsSetupOUTReceived()));
+ Endpoint_ClearSetupOUT();
}
break;