diff options
Diffstat (limited to 'tmk_core/protocol')
| -rw-r--r-- | tmk_core/protocol/usb_descriptor.c | 4 | ||||
| -rw-r--r-- | tmk_core/protocol/usb_descriptor_common.h | 4 | ||||
| -rw-r--r-- | tmk_core/protocol/vusb/vusb.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index c88aceb6e..7a4a79031 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c | |||
| @@ -953,10 +953,10 @@ const USB_Descriptor_String_t PROGMEM ProductString = { | |||
| 953 | #if defined(SERIAL_NUMBER) | 953 | #if defined(SERIAL_NUMBER) |
| 954 | const USB_Descriptor_String_t PROGMEM SerialNumberString = { | 954 | const USB_Descriptor_String_t PROGMEM SerialNumberString = { |
| 955 | .Header = { | 955 | .Header = { |
| 956 | .Size = USB_STRING_LEN(sizeof(STR(SERIAL_NUMBER)) - 1), // Subtract 1 for null terminator | 956 | .Size = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1), // Subtract 1 for null terminator |
| 957 | .Type = DTYPE_String | 957 | .Type = DTYPE_String |
| 958 | }, | 958 | }, |
| 959 | .UnicodeString = LSTR(SERIAL_NUMBER) | 959 | .UnicodeString = USBSTR(SERIAL_NUMBER) |
| 960 | }; | 960 | }; |
| 961 | #endif | 961 | #endif |
| 962 | 962 | ||
diff --git a/tmk_core/protocol/usb_descriptor_common.h b/tmk_core/protocol/usb_descriptor_common.h index b1f602c82..ce0cf0976 100644 --- a/tmk_core/protocol/usb_descriptor_common.h +++ b/tmk_core/protocol/usb_descriptor_common.h | |||
| @@ -16,6 +16,10 @@ | |||
| 16 | 16 | ||
| 17 | #pragma once | 17 | #pragma once |
| 18 | 18 | ||
| 19 | // Prefix string literal with L for descriptors | ||
| 20 | #define USBCONCAT(a, b) a##b | ||
| 21 | #define USBSTR(s) USBCONCAT(L, s) | ||
| 22 | |||
| 19 | ///////////////////// | 23 | ///////////////////// |
| 20 | // RAW Usage page and ID configuration | 24 | // RAW Usage page and ID configuration |
| 21 | 25 | ||
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index 876a31378..98cebf601 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c | |||
| @@ -599,10 +599,10 @@ const PROGMEM usbStringDescriptor_t usbStringDescriptorProduct = { | |||
| 599 | #if defined(SERIAL_NUMBER) | 599 | #if defined(SERIAL_NUMBER) |
| 600 | const PROGMEM usbStringDescriptor_t usbStringDescriptorSerial = { | 600 | const PROGMEM usbStringDescriptor_t usbStringDescriptorSerial = { |
| 601 | .header = { | 601 | .header = { |
| 602 | .bLength = USB_STRING_LEN(sizeof(STR(SERIAL_NUMBER)) - 1), | 602 | .bLength = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1), |
| 603 | .bDescriptorType = USBDESCR_STRING | 603 | .bDescriptorType = USBDESCR_STRING |
| 604 | }, | 604 | }, |
| 605 | .bString = LSTR(SERIAL_NUMBER) | 605 | .bString = USBSTR(SERIAL_NUMBER) |
| 606 | }; | 606 | }; |
| 607 | #endif | 607 | #endif |
| 608 | 608 | ||
