From 086975bd9442e86693fce2d16f003c4ad170cdac Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 22 Apr 2018 15:59:23 +1000 Subject: Fix USB_STRING_DESCRIPTOR_ARRAY() not accepting more than two byte long arrays. --- LUFA/DoxygenPages/ChangeLog.txt | 1 + LUFA/Drivers/USB/Core/StdDescriptors.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 719ae2209..bfeb0f121 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -18,6 +18,7 @@ * character after a successful write (thanks to NicoHood) * - Fixed incorrect endpoint bank setup on the UC3 architecture (thanks to Andrus Aaslaid) * - Fixed CDC_Device_Send*_P() and CDC_Host_Send*_P() variant functions not compiled out for UC3 architecture + * - Fixed USB_STRING_DESCRIPTOR_ARRAY() not accepting more than two byte long arrays * - Library Applications: * - Fixed bootloaders not disabling global interrupts during erase and write operations (thanks to Zoltan) * - Fixed bootloaders accepting flash writes to the bootloader region (thanks to NicoHood) diff --git a/LUFA/Drivers/USB/Core/StdDescriptors.h b/LUFA/Drivers/USB/Core/StdDescriptors.h index 20cc44f72..d8e8d3a3e 100644 --- a/LUFA/Drivers/USB/Core/StdDescriptors.h +++ b/LUFA/Drivers/USB/Core/StdDescriptors.h @@ -97,7 +97,7 @@ * * \param[in] ... Characters to initialize a USB String Descriptor structure with. */ - #define USB_STRING_DESCRIPTOR_ARRAY(...) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} } + #define USB_STRING_DESCRIPTOR_ARRAY(...) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + sizeof((uint16_t[]){__VA_ARGS__}), .Type = DTYPE_String}, .UnicodeString = {__VA_ARGS__} } /** Macro to encode a given major/minor/revision version number into Binary Coded Decimal format for descriptor * fields requiring BCD encoding, such as the USB version number in the standard device descriptor. -- cgit v1.2.3