aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/LowLevel
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-06-09 04:27:53 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-06-09 04:27:53 +0000
commit34f6e0dd33230441b8a91130467b3164e343853e (patch)
treefaa956d17123ea95715e0feda413a23151016edb /Demos/Host/LowLevel
parentccf5bd19f2d750440043b242cf26fcda09b69cce (diff)
downloadlufa-34f6e0dd33230441b8a91130467b3164e343853e.tar.gz
lufa-34f6e0dd33230441b8a91130467b3164e343853e.tar.bz2
lufa-34f6e0dd33230441b8a91130467b3164e343853e.zip
Deleted Host ClassDriver demos -- not yet started, faster to rebase new ClassDriver demos from the newly schedulerless LowLevel host demos rather than re-convert each demo from the previous scheduler-based implementations.
Fixes to MassStorageHost demo to improve compatibility with more USB drives.
Diffstat (limited to 'Demos/Host/LowLevel')
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c16
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h2
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c1
3 files changed, 13 insertions, 6 deletions
diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c
index 95aafca8c..afeace02f 100644
--- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c
+++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.c
@@ -107,10 +107,6 @@ static uint8_t MassStore_WaitForDataReceived(void)
{
uint16_t TimeoutMSRem = COMMAND_DATA_TIMEOUT_MS;
- /* Unfreeze the OUT pipe so that it can be checked */
- Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
- Pipe_Unfreeze();
-
/* Select the IN data pipe for data reception */
Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
Pipe_Unfreeze();
@@ -130,7 +126,9 @@ static uint8_t MassStore_WaitForDataReceived(void)
return PIPE_RWSTREAM_Timeout;
}
+ Pipe_Freeze();
Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
+ Pipe_Unfreeze();
/* Check if pipe stalled (command failed by device) */
if (Pipe_IsStalled())
@@ -140,8 +138,10 @@ static uint8_t MassStore_WaitForDataReceived(void)
return PIPE_RWSTREAM_PipeStalled;
}
-
+
+ Pipe_Freeze();
Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
+ Pipe_Unfreeze();
/* Check if pipe stalled (command failed by device) */
if (Pipe_IsStalled())
@@ -156,6 +156,12 @@ static uint8_t MassStore_WaitForDataReceived(void)
if (!(USB_IsConnected))
return PIPE_RWSTREAM_DeviceDisconnected;
};
+
+ Pipe_SelectPipe(MASS_STORE_DATA_IN_PIPE);
+ Pipe_Freeze();
+
+ Pipe_SelectPipe(MASS_STORE_DATA_OUT_PIPE);
+ Pipe_Freeze();
return PIPE_RWSTREAM_NoError;
}
diff --git a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
index 28f6a1561..e939f1c86 100644
--- a/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
+++ b/Demos/Host/LowLevel/MassStorageHost/Lib/MassStoreCommands.h
@@ -64,7 +64,7 @@
#define COMMAND_DIRECTION_DATA_IN (1 << 7)
/** Timeout period between the issuing of a CBW to a device, and the reception of the first packet */
- #define COMMAND_DATA_TIMEOUT_MS 500
+ #define COMMAND_DATA_TIMEOUT_MS 2000
/** Pipe number of the Mass Storage data IN pipe */
#define MASS_STORE_DATA_IN_PIPE 1
diff --git a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
index 6810320e8..354a75fc7 100644
--- a/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
+++ b/Demos/Host/LowLevel/MassStorageHost/MassStorageHost.c
@@ -74,6 +74,7 @@ void SetupHardware(void)
SerialStream_Init(9600, false);
LEDs_Init();
Buttons_Init();
+ USB_Init();
}
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and