Fixed broken USB_GetNextDescriptor() function causing the descriptor to jump ahead...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 24 Nov 2009 01:56:59 +0000 (01:56 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 24 Nov 2009 01:56:59 +0000 (01:56 +0000)
Fixed Pipe_IsEndpointBound() not masking the given Endpoint Address against PIPE_EPNUM_MASK.

LUFA/Drivers/Board/Temperature.h
LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
LUFA/Drivers/USB/LowLevel/Pipe.c
LUFA/ManPages/ChangeLog.txt

index 1a94d14..ace3112 100644 (file)
@@ -90,8 +90,8 @@
                                /** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.\r
                                 *  This must be called before any other temperature sensor routines.\r
                                 *\r
-                                *  The ADC itself (not the ADC channel) must be configured separately before calling the temperature\r
-                                *  sensor functions.\r
+                                *  \note The ADC itself (not the ADC channel) must be configured separately before calling the\r
+                                *        temperature sensor functions.\r
                                 */\r
                                static inline void Temperature_Init(void);\r
                        #else\r
index 3c51393..84a6f0c 100644 (file)
                         *\r
                         *  \see \ref USB_GetNextDescriptorComp function for more details\r
                         */\r
-                       typedef uint8_t (* const ConfigComparatorPtr_t)(void* const);\r
+                       typedef uint8_t (* const ConfigComparatorPtr_t)(void*);\r
 \r
                /* Function Prototypes: */\r
                        /** Searches for the next descriptor in the given configuration descriptor using a premade comparator\r
                        {\r
                                uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;\r
 \r
-                               *((uint8_t**)CurrConfigLoc) += CurrDescriptorSize;\r
-                               *BytesRem                   -= CurrDescriptorSize;\r
+                               *CurrConfigLoc += CurrDescriptorSize;\r
+                               *BytesRem      -= CurrDescriptorSize;\r
                        }\r
                        \r
        /* Disable C linkage for C++ Compilers: */\r
index 3f5272a..ccab074 100644 (file)
@@ -78,7 +78,7 @@ bool Pipe_IsEndpointBound(const uint8_t EndpointAddress)
        {\r
                Pipe_SelectPipe(PNum);\r
                \r
-               if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == EndpointAddress))\r
+               if (Pipe_IsConfigured() && (Pipe_BoundEndpointNumber() == (EndpointAddress & PIPE_EPNUM_MASK)))\r
                  return true;\r
        }\r
        \r
index 6a9155b..5cb7862 100644 (file)
@@ -25,6 +25,8 @@
   *  - Added missing CDC_Host_CreateBlockingStream() function code to the CDC Host Class driver\r
   *  - Fixed incorrect values for REPORT_ITEM_TYPE_* enum values causing corrupt data in the HID Host Parser\r
   *  - Fixed misnamed SI_Host_USBTask() and SI_Host_ConfigurePipes() functions\r
+  *  - Fixed broken USB_GetNextDescriptor() function causing the descriptor to jump ahead double the expected amount\r
+  *  - Fixed Pipe_IsEndpointBound() not masking the given Endpoint Address against PIPE_EPNUM_MASK\r
   *\r
   *  \section Sec_ChangeLog091122 Version 091122\r
   *\r