forked from mirror/qmk_firmware
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.
This commit is contained in:
@@ -90,8 +90,8 @@
|
||||
/** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.
|
||||
* This must be called before any other temperature sensor routines.
|
||||
*
|
||||
* The ADC itself (not the ADC channel) must be configured separately before calling the temperature
|
||||
* sensor functions.
|
||||
* \note The ADC itself (not the ADC channel) must be configured separately before calling the
|
||||
* temperature sensor functions.
|
||||
*/
|
||||
static inline void Temperature_Init(void);
|
||||
#else
|
||||
|
||||
@@ -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: */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user