From 092f82e06fc64436fd957b4b6b8d5ce33532efae Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 24 Aug 2010 13:02:38 +0000 Subject: Changed the signature of the CALLBACK_USB_GetDescriptor() callback function so that the descriptor pointer is const, to remove the need for extra casting inside the callback (thanks to Jonathan Kollasch). --- Bootloaders/DFU/Descriptors.c | 6 +++--- Bootloaders/DFU/Descriptors.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'Bootloaders/DFU') diff --git a/Bootloaders/DFU/Descriptors.c b/Bootloaders/DFU/Descriptors.c index 4e7272cb7..ad4e06a92 100644 --- a/Bootloaders/DFU/Descriptors.c +++ b/Bootloaders/DFU/Descriptors.c @@ -145,13 +145,13 @@ USB_Descriptor_String_t ProductString = */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, - void** const DescriptorAddress) + const void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); - void* Address = NULL; - uint16_t Size = NO_DESCRIPTOR; + const void* Address = NULL; + uint16_t Size = NO_DESCRIPTOR; switch (DescriptorType) { diff --git a/Bootloaders/DFU/Descriptors.h b/Bootloaders/DFU/Descriptors.h index d89cc9046..fc3d5ffce 100644 --- a/Bootloaders/DFU/Descriptors.h +++ b/Bootloaders/DFU/Descriptors.h @@ -168,6 +168,7 @@ /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, - void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); + const void** const DescriptorAddress) + ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); #endif -- cgit v1.2.3