Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensur...
[pub/lufa.git] / Demos / Host / MassStorageHost / MassStoreCommands.c
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