aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-11-24 01:56:59 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-11-24 01:56:59 +0000
commite4bf986bb351121a39076a7c85c09cd40b43f123 (patch)
tree9a7a7805c124c0ce02f4e646a543e9c33980eda9 /LUFA/Drivers/USB
parent702bec892da743c5b2d57b6a3fa2404d4d17e928 (diff)
downloadlufa-e4bf986bb351121a39076a7c85c09cd40b43f123.tar.gz
lufa-e4bf986bb351121a39076a7c85c09cd40b43f123.tar.bz2
lufa-e4bf986bb351121a39076a7c85c09cd40b43f123.zip
Fixed broken USB_GetNextDescriptor() function causing the descriptor to jump ahead double the expected amount.
Fixed Pipe_IsEndpointBound() not masking the given Endpoint Address against PIPE_EPNUM_MASK.
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r--LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h6
-rw-r--r--LUFA/Drivers/USB/LowLevel/Pipe.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
index 3c51393f1..84a6f0cf0 100644
--- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
+++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
@@ -109,7 +109,7 @@
*
* \see \ref USB_GetNextDescriptorComp function for more details
*/
- typedef uint8_t (* const ConfigComparatorPtr_t)(void* const);
+ typedef uint8_t (* const ConfigComparatorPtr_t)(void*);
/* Function Prototypes: */
/** Searches for the next descriptor in the given configuration descriptor using a premade comparator
@@ -263,8 +263,8 @@
{
uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
- *((uint8_t**)CurrConfigLoc) += CurrDescriptorSize;
- *BytesRem -= CurrDescriptorSize;
+ *CurrConfigLoc += CurrDescriptorSize;
+ *BytesRem -= CurrDescriptorSize;
}
/* Disable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c
index 3f5272a36..ccab07413 100644
--- a/LUFA/Drivers/USB/LowLevel/Pipe.c
+++ b/LUFA/Drivers/USB/LowLevel/Pipe.c
@@ -78,7 +78,7 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
{
Pipe_SelectPipe(PNum);
- if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == EndpointAddress))
+ if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))
return true;
}