Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensur...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 5 Apr 2009 04:05:07 +0000 (04:05 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 5 Apr 2009 04:05:07 +0000 (04:05 +0000)
Demos/Host/MassStorageHost/MassStoreCommands.c
LUFA/ChangeLog.txt

index 700d969..0d88acb 100644 (file)
@@ -215,6 +215,10 @@ static uint8_t MassStore_GetReturnedStatus(void)
 {\r
        uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;\r
 \r
+       /* If an error in the command ocurred, abort */\r
+       if (MassStore_WaitForDataReceived() != NoError)\r
+         return;\r
+\r
        /* Select the IN data pipe for data reception */\r
        Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);\r
        Pipe_Unfreeze();\r
index 3622f66..cea1166 100644 (file)
@@ -15,6 +15,8 @@
   *    time options\r
   *  - All comments in the library, bootloaders, demos and projects have now been spell-checked and spelling mistakes/typos corrected\r
   *  - Added new PIMA_DATA_SIZE() define to the Still Image Host demo\r
+  *  - Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensure that the CSW has been received in the extended\r
+  *    MSC timeout period before continuing, to prevent long processing delays from causing the MassStore_GetReturnedStatus() to early-abort\r
   *\r
   *  \section Sec_ChangeLog090401 Version 090401\r
   *\r