Fix incorrect definition for the XMEGA Endpoint_BytesInEndpoint() function when used on OUT endpoints.

This commit is contained in:
Dean Camera 2012-05-26 15:06:00 +00:00
parent 55283475d3
commit f235021abe
1 changed files with 4 additions and 1 deletions

View File

@ -274,7 +274,10 @@
static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint16_t Endpoint_BytesInEndpoint(void)
{
return USB_Endpoint_SelectedFIFO->Position;
if (USB_Endpoint_SelectedEndpoint & ENDPOINT_DIR_IN)
return USB_Endpoint_SelectedFIFO->Position;
else
return (USB_Endpoint_SelectedFIFO->Length - USB_Endpoint_SelectedFIFO->Position);
}
/** Get the endpoint address of the currently selected endpoint. This is typically used to save