projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed incorrect PID value being used in the USBtoSerial project (thanks to Phill).
[pub/lufa.git]
/
Demos
/
Device
/
MassStorage
/
MassStorage.c
diff --git
a/Demos/Device/MassStorage/MassStorage.c
b/Demos/Device/MassStorage/MassStorage.c
index
c50ca3d
..
82e7e8a
100644
(file)
--- a/
Demos/Device/MassStorage/MassStorage.c
+++ b/
Demos/Device/MassStorage/MassStorage.c
@@
-86,7
+86,7
@@
int main(void)
}
\r
\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
\r
}
\r
\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
\r
-
EVENT_HANDLER(USB_Connect
)
\r
+
void EventHandler_USB_Connect(void
)
\r
{
\r
/* Indicate USB enumerating */
\r
UpdateStatus(Status_USBEnumerating);
\r
{
\r
/* Indicate USB enumerating */
\r
UpdateStatus(Status_USBEnumerating);
\r
@@
-98,7
+98,7
@@
EVENT_HANDLER(USB_Connect)
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
\r
* the status LEDs and stops the Mass Storage management task.
\r
*/
\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
\r
* the status LEDs and stops the Mass Storage management task.
\r
*/
\r
-
EVENT_HANDLER(USB_Disconnect
)
\r
+
void EventHandler_USB_Disconnect(void
)
\r
{
\r
/* Stop running mass storage task */
\r
Scheduler_SetTaskMode(USB_MassStorage, TASK_STOP);
\r
{
\r
/* Stop running mass storage task */
\r
Scheduler_SetTaskMode(USB_MassStorage, TASK_STOP);
\r
@@
-110,7
+110,7
@@
EVENT_HANDLER(USB_Disconnect)
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
\r
* of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.
\r
*/
\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
\r
* of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.
\r
*/
\r
-
EVENT_HANDLER(USB_ConfigurationChange
d)
\r
+
void EventHandler_USB_ConfigurationChanged(voi
d)
\r
{
\r
/* Setup Mass Storage In and Out Endpoints */
\r
Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK,
\r
{
\r
/* Setup Mass Storage In and Out Endpoints */
\r
Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK,
\r
@@
-132,7
+132,7
@@
EVENT_HANDLER(USB_ConfigurationChanged)
* control requests that are not handled internally by the USB library (including the Mass Storage class-specific
\r
* requests) so that they can be handled appropriately for the application.
\r
*/
\r
* control requests that are not handled internally by the USB library (including the Mass Storage class-specific
\r
* requests) so that they can be handled appropriately for the application.
\r
*/
\r
-
EVENT_HANDLER(USB_UnhandledControlPacket
)
\r
+
void EventHandler_USB_UnhandledControlPacket(void
)
\r
{
\r
/* Process UFI specific control requests */
\r
switch (USB_ControlRequest.bRequest)
\r
{
\r
/* Process UFI specific control requests */
\r
switch (USB_ControlRequest.bRequest)
\r
@@
-249,6
+249,11
@@
TASK(USB_MassStorage)
/* Reset the data endpoint banks */
\r
Endpoint_ResetFIFO(MASS_STORAGE_OUT_EPNUM);
\r
Endpoint_ResetFIFO(MASS_STORAGE_IN_EPNUM);
\r
/* Reset the data endpoint banks */
\r
Endpoint_ResetFIFO(MASS_STORAGE_OUT_EPNUM);
\r
Endpoint_ResetFIFO(MASS_STORAGE_IN_EPNUM);
\r
+
\r
+ Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
\r
+ Endpoint_ClearStall();
\r
+ Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM);
\r
+ Endpoint_ClearStall();
\r
\r
/* Clear the abort transfer flag */
\r
IsMassStoreReset = false;
\r
\r
/* Clear the abort transfer flag */
\r
IsMassStoreReset = false;
\r
@@
-278,7
+283,7
@@
static bool ReadInCommandBlock(void)
\r
/* Read in command block header */
\r
Endpoint_Read_Stream_LE(&CommandBlock, (sizeof(CommandBlock) - sizeof(CommandBlock.SCSICommandData)),
\r
\r
/* Read in command block header */
\r
Endpoint_Read_Stream_LE(&CommandBlock, (sizeof(CommandBlock) - sizeof(CommandBlock.SCSICommandData)),
\r
- AbortOnMassStoreReset);
\r
+
StreamCallback_
AbortOnMassStoreReset);
\r
\r
/* Check if the current command is being aborted by the host */
\r
if (IsMassStoreReset)
\r
\r
/* Check if the current command is being aborted by the host */
\r
if (IsMassStoreReset)
\r
@@
-300,7
+305,7
@@
static bool ReadInCommandBlock(void)
/* Read in command block command data */
\r
Endpoint_Read_Stream_LE(&CommandBlock.SCSICommandData,
\r
CommandBlock.SCSICommandLength,
\r
/* Read in command block command data */
\r
Endpoint_Read_Stream_LE(&CommandBlock.SCSICommandData,
\r
CommandBlock.SCSICommandLength,
\r
- AbortOnMassStoreReset);
\r
+
StreamCallback_
AbortOnMassStoreReset);
\r
\r
/* Check if the current command is being aborted by the host */
\r
if (IsMassStoreReset)
\r
\r
/* Check if the current command is being aborted by the host */
\r
if (IsMassStoreReset)
\r
@@
-341,7
+346,7
@@
static void ReturnCommandStatus(void)
\r
/* Write the CSW to the endpoint */
\r
Endpoint_Write_Stream_LE(&CommandStatus, sizeof(CommandStatus),
\r
\r
/* Write the CSW to the endpoint */
\r
Endpoint_Write_Stream_LE(&CommandStatus, sizeof(CommandStatus),
\r
- AbortOnMassStoreReset);
\r
+
StreamCallback_
AbortOnMassStoreReset);
\r
\r
/* Check if the current command is being aborted by the host */
\r
if (IsMassStoreReset)
\r
\r
/* Check if the current command is being aborted by the host */
\r
if (IsMassStoreReset)
\r
@@
-354,7
+359,7
@@
static void ReturnCommandStatus(void)
/** Stream callback function for the Endpoint stream read and write functions. This callback will abort the current stream transfer
\r
* if a Mass Storage Reset request has been issued to the control endpoint.
\r
*/
\r
/** Stream callback function for the Endpoint stream read and write functions. This callback will abort the current stream transfer
\r
* if a Mass Storage Reset request has been issued to the control endpoint.
\r
*/
\r
-
STREAM_CALLBACK(AbortOnMassStoreReset
)
\r
+
uint8_t StreamCallback_AbortOnMassStoreReset(void
)
\r
{
\r
/* Abort if a Mass Storage reset command was received */
\r
if (IsMassStoreReset)
\r
{
\r
/* Abort if a Mass Storage reset command was received */
\r
if (IsMassStoreReset)
\r