diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2012-05-26 15:06:00 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2012-05-26 15:06:00 +0000 |
| commit | 0b2d1d6aa5a9462e0d33962cc0fb5c33002bb38a (patch) | |
| tree | 2e27186a53c9d69d42d02b87ef22618be32e143e /LUFA/Drivers/USB | |
| parent | 6d05c9e260a98730447e1bb5daa8d1b222f40a7c (diff) | |
Fix incorrect definition for the XMEGA Endpoint_BytesInEndpoint() function when used on OUT endpoints.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@2237 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB')
| -rw-r--r-- | LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h index 720b5f3b..23de8fc0 100644 --- a/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h +++ b/LUFA/Drivers/USB/Core/XMEGA/Endpoint_XMEGA.h @@ -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 |
