diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-08-24 13:02:38 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-08-24 13:02:38 +0000 |
commit | 092f82e06fc64436fd957b4b6b8d5ce33532efae (patch) | |
tree | 3060a52e5f3e3a3486e7d2bd272cfc8e7ab58190 /LUFA | |
parent | ed8ad18f26ef36a7c0cafd3aac1f672a06d14f76 (diff) | |
download | lufa-092f82e06fc64436fd957b4b6b8d5ce33532efae.tar.gz lufa-092f82e06fc64436fd957b4b6b8d5ce33532efae.tar.bz2 lufa-092f82e06fc64436fd957b4b6b8d5ce33532efae.zip |
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).
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c | 4 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Device.h | 2 | ||||
-rw-r--r-- | LUFA/ManPages/ChangeLog.txt | 2 | ||||
-rw-r--r-- | LUFA/ManPages/MigrationInformation.txt | 5 |
4 files changed, 10 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c index 64af1406b..1832d15be 100644 --- a/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c +++ b/LUFA/Drivers/USB/HighLevel/DeviceStandardReq.c @@ -254,8 +254,8 @@ static void USB_Device_GetInternalSerialDescriptor(void) static void USB_Device_GetDescriptor(void) { - void* DescriptorPointer; - uint16_t DescriptorSize; + const void* DescriptorPointer; + uint16_t DescriptorSize; #if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS) uint8_t DescriptorAddressSpace; diff --git a/LUFA/Drivers/USB/LowLevel/Device.h b/LUFA/Drivers/USB/LowLevel/Device.h index c30da9c70..fdf4ee930 100644 --- a/LUFA/Drivers/USB/LowLevel/Device.h +++ b/LUFA/Drivers/USB/LowLevel/Device.h @@ -187,7 +187,7 @@ */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, - void** const DescriptorAddress + const void** const DescriptorAddress #if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS) , uint8_t* MemoryAddressSpace #endif diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 6c77bcd2f..e71a6f0d2 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -24,6 +24,8 @@ * - Changed all Device mode LowLevel demos and Device Class drivers so that the control request is acknowledged and any data * transferred as quickly as possible without any processing inbetween sections, so that long callbacks or event handlers will * not break communications with the host by exceeding the maximum control request stage timeout period + * - 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) * * <b>Fixed:</b> * - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist diff --git a/LUFA/ManPages/MigrationInformation.txt b/LUFA/ManPages/MigrationInformation.txt index 49c9e6337..40fb70a25 100644 --- a/LUFA/ManPages/MigrationInformation.txt +++ b/LUFA/ManPages/MigrationInformation.txt @@ -18,6 +18,11 @@ * - A new USB driver source file, Drivers/USB/HighLevel/PipeStream.c now exists. This source file should be added to all * project makefiles using the USB driver of LUFA, or the makefile should be updated to use the new module source variables. * + * <b>Device Mode</b> + * - The signature for the CALLBACK_USB_GetDescriptor() callback has changed, the "void** const DescriptorAddress" parameter is + * now "const void** const DescriptorAddress". Existing applications should update their callback signatures to match this, and + * eliminate any casting of descriptor pointers to a non-const pointer. + * * \section Sec_Migration100807 Migrating from 100513 to 100807 * * <b>Non-USB Library Components</b> |