aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-15 12:50:23 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-15 12:50:23 +0000
commit21cc9c9e19ce6bd757410cc6da29b5dc2ee8041c (patch)
treea9929744079eb17dae2e6cb52bf0513467b485f3 /Demos/Device/LowLevel
parent588886878e0fe948417123b57c108a1bd7992f85 (diff)
downloadlufa-21cc9c9e19ce6bd757410cc6da29b5dc2ee8041c.tar.gz
lufa-21cc9c9e19ce6bd757410cc6da29b5dc2ee8041c.tar.bz2
lufa-21cc9c9e19ce6bd757410cc6da29b5dc2ee8041c.zip
Cleanups to the MassStorage Device demos, and the MassStorage Device Class driver.
Diffstat (limited to 'Demos/Device/LowLevel')
-rw-r--r--Demos/Device/LowLevel/MassStorage/MassStorage.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c
index c41b5777f..f9ec4a840 100644
--- a/Demos/Device/LowLevel/MassStorage/MassStorage.c
+++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c
@@ -141,7 +141,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
Endpoint_ClearSETUP();
/* Indicate that the current transfer should be aborted */
- IsMassStoreReset = true;
+ IsMassStoreReset = true;
Endpoint_ClearStatusStage();
}
@@ -204,19 +204,6 @@ void MassStorage_Task(void)
/* Return command status block to the host */
ReturnCommandStatus();
-
- /* Check if a Mass Storage Reset occurred */
- if (IsMassStoreReset)
- {
- /* Reset the data endpoint banks */
- Endpoint_ResetFIFO(MASS_STORAGE_OUT_EPNUM);
- Endpoint_ResetFIFO(MASS_STORAGE_IN_EPNUM);
-
- Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
- Endpoint_ClearStall();
- Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
- Endpoint_ClearStall();
- }
/* Indicate ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -228,8 +215,23 @@ void MassStorage_Task(void)
}
}
- /* Clear the abort transfer flag */
- IsMassStoreReset = false;
+ /* Check if a Mass Storage Reset occurred */
+ if (IsMassStoreReset)
+ {
+ /* Reset the data endpoint banks */
+ Endpoint_ResetFIFO(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_ResetFIFO(MASS_STORAGE_IN_EPNUM);
+
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_ClearStall();
+ Endpoint_ResetDataToggle();
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
+ Endpoint_ClearStall();
+ Endpoint_ResetDataToggle();
+
+ /* Clear the abort transfer flag */
+ IsMassStoreReset = false;
+ }
}
/** Function to read in a command block from the host, via the bulk data OUT endpoint. This function reads in the next command block