aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-05-30 14:01:41 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-05-30 14:01:41 +0000
commit152b2764c3c719e3e9e34ee60b5db8d99ff2611b (patch)
treead8580af599e27a1a8e1ca0baa5f1f7e27568ba7
parente95c96ea20117dbf43bd37e4abb5bad974f30816 (diff)
downloadlufa-152b2764c3c719e3e9e34ee60b5db8d99ff2611b.tar.gz
lufa-152b2764c3c719e3e9e34ee60b5db8d99ff2611b.tar.bz2
lufa-152b2764c3c719e3e9e34ee60b5db8d99ff2611b.zip
Small tweaks to ConfigDescriptor.c/.h to ensure pointers use the correct type, and to remove const attribute from the descriptor comparator callback function pointer type define, and into the function prototype instead.
-rw-r--r--Bootloaders/CDC/makefile4
-rw-r--r--Bootloaders/DFU/makefile4
-rw-r--r--LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c8
-rw-r--r--LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h10
4 files changed, 14 insertions, 12 deletions
diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile
index 732198942..63e0ed5b1 100644
--- a/Bootloaders/CDC/makefile
+++ b/Bootloaders/CDC/makefile
@@ -85,7 +85,9 @@ F_CPU = 8000000
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
diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile
index 6695ff5ad..164295bd9 100644
--- a/Bootloaders/DFU/makefile
+++ b/Bootloaders/DFU/makefile
@@ -85,7 +85,9 @@ F_CPU = 8000000
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
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
index f6a6e5ebe..07a3d4292 100644
--- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
+++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.c
@@ -114,17 +114,17 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
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* PrevDescLoc = *CurrConfigLoc;
- uint16_t PrevBytesRem = *BytesRem;
+ void* PrevDescLoc = *CurrConfigLoc;
+ uint16_t PrevBytesRem = *BytesRem;
USB_GetNextDescriptor(BytesRem, CurrConfigLoc);
-
+
if ((ErrorCode = ComparatorRoutine(*CurrConfigLoc)) != DESCRIPTOR_SEARCH_NotFound)
{
if (ErrorCode == DESCRIPTOR_SEARCH_Fail)
diff --git a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
index 1bf4aca50..211128ca2 100644
--- a/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
+++ b/LUFA/Drivers/USB/HighLevel/ConfigDescriptor.h
@@ -118,7 +118,7 @@
*
* \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
@@ -161,7 +161,7 @@
* }
* \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. */
@@ -264,11 +264,9 @@
* \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);
- 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;