Small tweaks to ConfigDescriptor.c/.h to ensure pointers use the correct type, and...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 30 May 2010 14:01:41 +0000 (14:01 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 30 May 2010 14:01:41 +0000 (14:01 +0000)
Bootloaders/CDC/makefile
Bootloaders/DFU/makefile
LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h

index 7321989..63e0ed5 100644 (file)
@@ -85,7 +85,9 @@ F_CPU = 8000000
 F_CLOCK = $(F_CPU)
 
 
 F_CLOCK = $(F_CPU)
 
 
-# Starting byte address of the bootloader
+# Starting byte address of the bootloader, as a byte address. Note that the address given
+# in the AVRStudio fuse programming dialogue uses word addresses, which will have to be
+# doubled to obtain the starting byte address of the bootloader section.
 BOOT_START = 0x1E000
 
 
 BOOT_START = 0x1E000
 
 
index 6695ff5..164295b 100644 (file)
@@ -85,7 +85,9 @@ F_CPU = 8000000
 F_CLOCK = $(F_CPU)
 
 
 F_CLOCK = $(F_CPU)
 
 
-# Starting byte address of the bootloader
+# Starting byte address of the bootloader, as a byte address. Note that the address given
+# in the AVRStudio fuse programming dialogue uses word addresses, which will have to be
+# doubled to obtain the starting byte address of the bootloader section.
 BOOT_START = 0x1E000
 
 
 BOOT_START = 0x1E000
 
 
index f6a6e5e..07a3d42 100644 (file)
@@ -114,17 +114,17 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
          USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);
 }
                        
          USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);
 }
                        
-uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine)
+uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine)
 {
        uint8_t ErrorCode;
                
        while (*BytesRem)
        {
 {
        uint8_t ErrorCode;
                
        while (*BytesRem)
        {
-               uint8_t*  PrevDescLoc  = *CurrConfigLoc;
-               uint16_t  PrevBytesRem = *BytesRem;
+               void*    PrevDescLoc  = *CurrConfigLoc;
+               uint16_t PrevBytesRem = *BytesRem;
 
                USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
 
                USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
-
+                               
                if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound)
                {
                        if (ErrorCode == DESCRIPTOR_SEARCH_Fail)
                if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound)
                {
                        if (ErrorCode == DESCRIPTOR_SEARCH_Fail)
index 1bf4aca..211128c 100644 (file)
                         *
                         *  \see \ref USB_GetNextDescriptorComp function for more details
                         */
                         *
                         *  \see \ref USB_GetNextDescriptorComp function for more details
                         */
-                       typedef uint8_t (* const ConfigComparatorPtr_t)(void*);
+                       typedef uint8_t (* ConfigComparatorPtr_t)(void*);
 
                /* Function Prototypes: */
                        /** Searches for the next descriptor in the given configuration descriptor using a premade comparator
 
                /* Function Prototypes: */
                        /** Searches for the next descriptor in the given configuration descriptor using a premade comparator
                         *  }
                         *  \endcode
                         */
                         *  }
                         *  \endcode
                         */
-                       uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t ComparatorRoutine);
+                       uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine);
                        
                /* Enums: */
                        /** Enum for the possible return codes of the \ref USB_Host_GetDeviceConfigDescriptor() function. */
                        
                /* Enums: */
                        /** Enum for the possible return codes of the \ref USB_Host_GetDeviceConfigDescriptor() function. */
                         * \param[in,out] BytesRem       Pointer to the number of bytes remaining of the configuration descriptor
                         * \param[in,out] CurrConfigLoc  Pointer to the current descriptor inside the configuration descriptor
                         */
                         * \param[in,out] BytesRem       Pointer to the number of bytes remaining of the configuration descriptor
                         * \param[in,out] CurrConfigLoc  Pointer to the current descriptor inside the configuration descriptor
                         */
-                       static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
-                                                                void** const CurrConfigLoc) 
+                       static inline void USB_GetNextDescriptor(uint16_t* const BytesRem, void** CurrConfigLoc) 
                                                                 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);                                                                       
                                                                 ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);                                                                       
-                       static inline void USB_GetNextDescriptor(uint16_t* const BytesRem,
-                                                                void** const CurrConfigLoc)
+                       static inline void USB_GetNextDescriptor(uint16_t* const BytesRem, void** CurrConfigLoc)
                        {
                                uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;
 
                        {
                                uint16_t CurrDescriptorSize = DESCRIPTOR_CAST(*CurrConfigLoc, USB_Descriptor_Header_t).Size;