aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Host/MassStorage.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-27 13:12:44 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-27 13:12:44 +0000
commit922e60192dc089654a82be0d789fb7a8ecc47039 (patch)
tree71fc15df3d3cc959dd7f16a69da42677d9897330 /LUFA/Drivers/USB/Class/Host/MassStorage.c
parent023838fe4aad5b5f0da00b767afd1400d4e40b4c (diff)
downloadlufa-922e60192dc089654a82be0d789fb7a8ecc47039.tar.gz
lufa-922e60192dc089654a82be0d789fb7a8ecc47039.tar.bz2
lufa-922e60192dc089654a82be0d789fb7a8ecc47039.zip
Condensed SCSI command functions in the LowLevel Mass Storage Host demo, to save on FLASH space.
Fixed issue in AVRISP project where the target RESET line was being toggled before it was tristated, causing problems synchronising to some targets (thanks to Mike Alex).
Diffstat (limited to 'LUFA/Drivers/USB/Class/Host/MassStorage.c')
-rw-r--r--LUFA/Drivers/USB/Class/Host/MassStorage.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/MassStorage.c b/LUFA/Drivers/USB/Class/Host/MassStorage.c
index ba281cfa4..65c49b15c 100644
--- a/LUFA/Drivers/USB/Class/Host/MassStorage.c
+++ b/LUFA/Drivers/USB/Class/Host/MassStorage.c
@@ -110,8 +110,10 @@ static uint8_t DComp_NextInterfaceBulkDataEndpoint(void* CurrentDescriptor)
{
if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)
{
- uint8_t EndpointType = (DESCRIPTOR_CAST(CurrentDescriptor,
- USB_Descriptor_Endpoint_t).Attributes & EP_TYPE_MASK);
+ USB_Descriptor_Endpoint_t* CurrentEndpoint = DESCRIPTOR_PCAST(CurrentDescriptor,
+ USB_Descriptor_Endpoint_t);
+
+ uint8_t EndpointType = (CurrentEndpoint->Attributes & EP_TYPE_MASK);
if ((EndpointType == EP_TYPE_BULK) &&
(!(Pipe_IsEndpointBound(CurrentEndpoint->EndpointAddress))))
@@ -137,7 +139,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* MSInterfaceInfo, MS_
{
uint8_t ErrorCode = PIPE_RWSTREAM_NoError;
- SCSICommandBlock->Tag = MSInterfaceInfo->State.TransactionTag++;
+ SCSICommandBlock->Tag = ++MSInterfaceInfo->State.TransactionTag;
if (MSInterfaceInfo->State.TransactionTag == 0xFFFFFFFF)
MSInterfaceInfo->State.TransactionTag = 1;