Remove redundant calls to USB_USBTask() in the Mass Storage Device Class driver when INTERRUPT_CONTROL_ENDPOINT is not used, as this is done inside the stream callbacks.

Fix implementations of Endpoint_SetEndpointDirection() and Endpoint_GetEndpointDirection() for the AVR8 architecture.
pull/1469/head
Dean Camera 13 years ago
parent 025742fca8
commit 40728fd20d

@ -165,10 +165,6 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
(sizeof(MS_CommandBlockWrapper_t) - 16), &BytesProcessed) ==
ENDPOINT_RWSTREAM_IncompleteTransfer)
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
USB_USBTask();
#endif
if (MSInterfaceInfo->State.IsMassStoreReset)
return false;
}
@ -191,10 +187,6 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte
MSInterfaceInfo->State.CommandBlock.SCSICommandLength, &BytesProcessed) ==
ENDPOINT_RWSTREAM_IncompleteTransfer)
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
USB_USBTask();
#endif
if (MSInterfaceInfo->State.IsMassStoreReset)
return false;
}
@ -210,10 +202,6 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt
while (Endpoint_IsStalled())
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
USB_USBTask();
#endif
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}
@ -222,10 +210,6 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt
while (Endpoint_IsStalled())
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
USB_USBTask();
#endif
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}
@ -235,10 +219,6 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt
sizeof(MS_CommandStatusWrapper_t), &BytesProcessed) ==
ENDPOINT_RWSTREAM_IncompleteTransfer)
{
#if !defined(INTERRUPT_CONTROL_ENDPOINT)
USB_USBTask();
#endif
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}

@ -587,7 +587,7 @@
static inline uint8_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_GetEndpointDirection(void)
{
return (UECFG0X & ENDPOINT_DIR_IN);
return (UECFG0X & (1 << EPDIR)) ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT;
}
/** Sets the direction of the currently selected endpoint.
@ -597,7 +597,7 @@
static inline void Endpoint_SetEndpointDirection(const uint8_t DirectionMask) ATTR_ALWAYS_INLINE;
static inline void Endpoint_SetEndpointDirection(const uint8_t DirectionMask)
{
UECFG0X = ((UECFG0X & ~ENDPOINT_DIR_IN) | DirectionMask);
UECFG0X = ((UECFG0X & ~(1 << EPDIR)) | (DirectionMask ? (1 << EPDIR) : 0));
}
/** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints.

Loading…
Cancel
Save