Fixed GenericHIDHost demo report write routine incorrect for control type requests...
[pub/USBasp.git] / Demos / Device / MassStorage / DataflashManager.c
index 7b02ed6..4b62419 100644 (file)
@@ -64,7 +64,7 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo
        Dataflash_SendAddressBytes(0, CurrDFPageByte);\r
 \r
        /* Wait until endpoint is ready before continuing */\r
        Dataflash_SendAddressBytes(0, CurrDFPageByte);\r
 \r
        /* Wait until endpoint is ready before continuing */\r
-       while (!(Endpoint_ReadWriteAllowed()));\r
+       while (!(Endpoint_IsReadWriteAllowed()));\r
 \r
        while (TotalBlocks)\r
        {\r
 \r
        while (TotalBlocks)\r
        {\r
@@ -74,13 +74,13 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo
                while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))\r
                {\r
                        /* Check if the endpoint is currently empty */\r
                while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))\r
                {\r
                        /* Check if the endpoint is currently empty */\r
-                       if (!(Endpoint_ReadWriteAllowed()))\r
+                       if (!(Endpoint_IsReadWriteAllowed()))\r
                        {\r
                                /* Clear the current endpoint bank */\r
                        {\r
                                /* Clear the current endpoint bank */\r
-                               Endpoint_ClearCurrentBank();\r
+                               Endpoint_ClearOUT();\r
                                \r
                                /* Wait until the host has sent another packet */\r
                                \r
                                /* Wait until the host has sent another packet */\r
-                               while (!(Endpoint_ReadWriteAllowed()));\r
+                               while (!(Endpoint_IsReadWriteAllowed()));\r
                        }\r
 \r
                        /* Check if end of dataflash page reached */\r
                        }\r
 \r
                        /* Check if end of dataflash page reached */\r
@@ -157,8 +157,8 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo
        Dataflash_WaitWhileBusy();\r
 \r
        /* If the endpoint is empty, clear it ready for the next packet from the host */\r
        Dataflash_WaitWhileBusy();\r
 \r
        /* If the endpoint is empty, clear it ready for the next packet from the host */\r
-       if (!(Endpoint_ReadWriteAllowed()))\r
-         Endpoint_ClearCurrentBank();\r
+       if (!(Endpoint_IsReadWriteAllowed()))\r
+         Endpoint_ClearOUT();\r
 \r
        /* Deselect all dataflash chips */\r
        Dataflash_DeselectChip();\r
 \r
        /* Deselect all dataflash chips */\r
        Dataflash_DeselectChip();\r
@@ -187,7 +187,7 @@ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBloc
        Dataflash_SendByte(0x00);\r
        \r
        /* Wait until endpoint is ready before continuing */\r
        Dataflash_SendByte(0x00);\r
        \r
        /* Wait until endpoint is ready before continuing */\r
-       while (!(Endpoint_ReadWriteAllowed()));\r
+       while (!(Endpoint_IsReadWriteAllowed()));\r
        \r
        while (TotalBlocks)\r
        {\r
        \r
        while (TotalBlocks)\r
        {\r
@@ -197,13 +197,13 @@ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBloc
                while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))\r
                {\r
                        /* Check if the endpoint is currently full */\r
                while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))\r
                {\r
                        /* Check if the endpoint is currently full */\r
-                       if (!(Endpoint_ReadWriteAllowed()))\r
+                       if (!(Endpoint_IsReadWriteAllowed()))\r
                        {\r
                                /* Clear the endpoint bank to send its contents to the host */\r
                        {\r
                                /* Clear the endpoint bank to send its contents to the host */\r
-                               Endpoint_ClearCurrentBank();\r
+                               Endpoint_ClearIN();\r
                                \r
                                /* Wait until the endpoint is ready for more data */\r
                                \r
                                /* Wait until the endpoint is ready for more data */\r
-                               while (!(Endpoint_ReadWriteAllowed()));\r
+                               while (!(Endpoint_IsReadWriteAllowed()));\r
                        }\r
                        \r
                        /* Check if end of dataflash page reached */\r
                        }\r
                        \r
                        /* Check if end of dataflash page reached */\r
@@ -259,8 +259,8 @@ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBloc
        }\r
        \r
        /* If the endpoint is full, send its contents to the host */\r
        }\r
        \r
        /* If the endpoint is full, send its contents to the host */\r
-       if (!(Endpoint_ReadWriteAllowed()))\r
-         Endpoint_ClearCurrentBank();\r
+       if (!(Endpoint_IsReadWriteAllowed()))\r
+         Endpoint_ClearIN();\r
 \r
        /* Deselect all dataflash chips */\r
        Dataflash_DeselectChip();\r
 \r
        /* Deselect all dataflash chips */\r
        Dataflash_DeselectChip();\r