Newer AS7 integration binary, with ASF detection fixes and newer image assets.
[pub/USBasp.git] / LUFA / Drivers / USB / Core / StdDescriptors.h
index cfd42c4..130b6be 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2014.
+     Copyright (C) Dean Camera, 2015.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2015  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
                         */
                        #define USB_STRING_LEN(UnicodeChars)      (sizeof(USB_Descriptor_Header_t) + ((UnicodeChars) << 1))
 
+                       /** Convenience macro to easily create \ref USB_Descriptor_String_t instances from a wide character string.
+                        *
+                        *  \note This macro is for little-endian systems only.
+                        *
+                        *  \param[in] String  String to initialize a USB String Descriptor structure with.
+                        */
+                       #define USB_STRING_DESCRIPTOR(String)     { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String }
+
+                       /** Convenience macro to easily create \ref USB_Descriptor_String_t instances from an array of characters.
+                        *
+                        *  \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__} }
+
                        /** 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.
                         *
                                #endif
                        } ATTR_PACKED USB_Descriptor_String_t;
 
-                       /** Convenience macro to easily create \ref USB_Descriptor_String_t instances without having to count characters. */
-                       #define USB_STRING_DESCRIPTOR(string) {.Header = {.Size = sizeof(string), .Type = DTYPE_String}, .UnicodeString = string}
-
                        /** \brief Standard USB String Descriptor (USB-IF naming conventions).
                         *
                         *  Type define for a standard string descriptor. Unlike other standard descriptors, the length