aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-04-05 04:05:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-04-05 04:05:07 +0000
commit01d388f293ba531008122ebb4cfcf7113a228398 (patch)
tree2e22297a4074b8583c181e301eb04cdda83fce1d /Demos
parent58f550dfb3b2035fccb4c046ad067cebddba7d61 (diff)
downloadlufa-01d388f293ba531008122ebb4cfcf7113a228398.tar.gz
lufa-01d388f293ba531008122ebb4cfcf7113a228398.tar.bz2
lufa-01d388f293ba531008122ebb4cfcf7113a228398.zip
Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensure that the CSW has been received in the extended MSC timeout period before continuing, to prevent long processing delays from causing the MassStore_GetReturnedStatus() to early-abort.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Host/MassStorageHost/MassStoreCommands.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Demos/Host/MassStorageHost/MassStoreCommands.c b/Demos/Host/MassStorageHost/MassStoreCommands.c
index 700d969db..0d88acbd5 100644
--- a/Demos/Host/MassStorageHost/MassStoreCommands.c
+++ b/Demos/Host/MassStorageHost/MassStoreCommands.c
@@ -215,6 +215,10 @@ static uint8_t MassStore_GetReturnedStatus(void)
{
uint8_t ErrorCode = PIPE_RWSTREAM_ERROR_NoError;
+ /* If an error in the command ocurred, abort */
+ if (MassStore_WaitForDataReceived() != NoError)
+ return;
+
/* Select the IN data pipe for data reception */
Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
Pipe_Unfreeze();