Fixed GenericHIDHost demo report write routine incorrect for control type requests...
[pub/USBasp.git] / Demos / Device / MassStorage / MassStorage.c
index 56bc19a..48ce5f3 100644 (file)
 #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
@@ -159,30 +153,30 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
                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
@@ -234,7 +228,7 @@ TASK(USB_MassStorage)
                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
@@ -326,7 +320,7 @@ static bool ReadInCommandBlock(void)
          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
@@ -367,7 +361,7 @@ static void ReturnCommandStatus(void)
          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