#define INCLUDE_FROM_MASSSTORAGE_C\r
#include "MassStorage.h"\r
\r
-/* Project Tags, for reading out using the ButtLoad project */\r
-BUTTLOADTAG(ProjName, "LUFA MassStore App");\r
-BUTTLOADTAG(BuildTime, __TIME__);\r
-BUTTLOADTAG(BuildDate, __DATE__);\r
-BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);\r
-\r
/* Scheduler Task List */\r
TASK_LIST\r
{\r
/** Structure to hold the latest Command Status Wrapper to return to the host, containing the status of the last issued command. */\r
CommandStatusWrapper_t CommandStatus = { Signature: CSW_SIGNATURE };\r
\r
-/** Flag to asyncronously abort any in-progress data transfers upon the reception of a mass storage reset command. */\r
+/** Flag to asynchronously abort any in-progress data transfers upon the reception of a mass storage reset command. */\r
volatile bool IsMassStoreReset = false;\r
\r
/** Main program entry point. This routine configures the hardware required by the application, then\r
case REQ_MassStorageReset:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
/* Indicate that the current transfer should be aborted */\r
IsMassStoreReset = true; \r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupINReady()));\r
- Endpoint_ClearSetupIN();\r
+ while (!(Endpoint_IsINReady()));\r
+ Endpoint_ClearControlIN();\r
}\r
\r
break;\r
case REQ_GetMaxLUN:\r
if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
{\r
- /* Indicate to the host the number of supported LUNs (virtual disks) on the device */\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
+ /* Indicate to the host the number of supported LUNs (virtual disks) on the device */\r
Endpoint_Write_Byte(TOTAL_LUNS - 1);\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
/* Acknowledge status stage */\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
}\r
\r
break;\r
Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);\r
\r
/* Check to see if a command from the host has been issued */\r
- if (Endpoint_ReadWriteAllowed())\r
+ if (Endpoint_IsReadWriteAllowed())\r
{ \r
/* Indicate busy */\r
UpdateStatus(Status_ProcessingCommandBlock);\r
/* Return command status block to the host */\r
ReturnCommandStatus();\r
\r
- /* Check if a Mass Storage Reset ocurred */\r
+ /* Check if a Mass Storage Reset occurred */\r
if (IsMassStoreReset)\r
{\r
/* Reset the data endpoint banks */\r
return false;\r
\r
/* Finalize the stream transfer to send the last packet */\r
- Endpoint_ClearCurrentBank();\r
+ Endpoint_ClearOUT();\r
\r
return true;\r
}\r
return;\r
\r
/* Finalize the stream transfer to send the last packet */\r
- Endpoint_ClearCurrentBank();\r
+ Endpoint_ClearIN();\r
}\r
\r
/** Stream callback function for the Endpoint stream read and write functions. This callback will abort the current stream transfer\r
/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when a control request has been issued to the control endpoint,\r
* so that the request can be processed. As several elements of the Mass Storage implementation require asynchronous control requests\r
* (such as endpoint stall clearing and Mass Storage Reset requests during data transfers) this is done via interrupts rather than\r
- * polling.\r
+ * polling so that they can be processed regardless of the rest of the application's state.\r
*/\r
ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)\r
{\r