diff options
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c | 2 | ||||
-rw-r--r-- | tmk_core/protocol/usb_descriptor.c | 12 | ||||
-rw-r--r-- | tmk_core/protocol/vusb/vusb.c | 12 | ||||
-rw-r--r-- | tmk_core/protocol/vusb/vusb.h | 2 |
4 files changed, 13 insertions, 15 deletions
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c index 69b3ad574c..58fc4efd9c 100644 --- a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c +++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c @@ -95,7 +95,7 @@ led_setup_t leds_rainbow_s[] = { void *led_setups[] = {leds_rainbow_s, leds_rainbow_ns, leds_teal_salmon, leds_yellow, leds_red, leds_green, leds_blue, leds_white, leds_white_with_red_stripe, leds_black_with_red_stripe, leds_off}; -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); +const uint8_t led_setups_count = ARRAY_SIZE(led_setups); # endif // USE_MASSDROP_CONFIGURATOR #endif // RGB_MATRIX_ENABLE
\ No newline at end of file diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 52e3276d35..635e4c6cd7 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -1043,7 +1043,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { */ const USB_Descriptor_String_t PROGMEM LanguageString = { .Header = { - .Size = USB_STRING_LEN(1), + .Size = 4, .Type = DTYPE_String }, .UnicodeString = {LANGUAGE_ID_ENG} @@ -1051,24 +1051,24 @@ const USB_Descriptor_String_t PROGMEM LanguageString = { const USB_Descriptor_String_t PROGMEM ManufacturerString = { .Header = { - .Size = USB_STRING_LEN(sizeof(STR(MANUFACTURER)) - 1), // Subtract 1 for null terminator + .Size = sizeof(USBSTR(MANUFACTURER)), .Type = DTYPE_String }, - .UnicodeString = LSTR(MANUFACTURER) + .UnicodeString = USBSTR(MANUFACTURER) }; const USB_Descriptor_String_t PROGMEM ProductString = { .Header = { - .Size = USB_STRING_LEN(sizeof(STR(PRODUCT)) - 1), // Subtract 1 for null terminator + .Size = sizeof(USBSTR(PRODUCT)), .Type = DTYPE_String }, - .UnicodeString = LSTR(PRODUCT) + .UnicodeString = USBSTR(PRODUCT) }; #if defined(SERIAL_NUMBER) const USB_Descriptor_String_t PROGMEM SerialNumberString = { .Header = { - .Size = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1), // Subtract 1 for null terminator + .Size = sizeof(USBSTR(SERIAL_NUMBER)), .Type = DTYPE_String }, .UnicodeString = USBSTR(SERIAL_NUMBER) diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index d07cc0d27e..65f5027574 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -672,7 +672,7 @@ const PROGMEM uchar console_hid_report[] = { // clang-format off const PROGMEM usbStringDescriptor_t usbStringDescriptorZero = { .header = { - .bLength = USB_STRING_LEN(1), + .bLength = 4, .bDescriptorType = USBDESCR_STRING }, .bString = {0x0409} // US English @@ -680,24 +680,24 @@ const PROGMEM usbStringDescriptor_t usbStringDescriptorZero = { const PROGMEM usbStringDescriptor_t usbStringDescriptorManufacturer = { .header = { - .bLength = USB_STRING_LEN(sizeof(STR(MANUFACTURER)) - 1), + .bLength = sizeof(USBSTR(MANUFACTURER)), .bDescriptorType = USBDESCR_STRING }, - .bString = LSTR(MANUFACTURER) + .bString = USBSTR(MANUFACTURER) }; const PROGMEM usbStringDescriptor_t usbStringDescriptorProduct = { .header = { - .bLength = USB_STRING_LEN(sizeof(STR(PRODUCT)) - 1), + .bLength = sizeof(USBSTR(PRODUCT)), .bDescriptorType = USBDESCR_STRING }, - .bString = LSTR(PRODUCT) + .bString = USBSTR(PRODUCT) }; #if defined(SERIAL_NUMBER) const PROGMEM usbStringDescriptor_t usbStringDescriptorSerial = { .header = { - .bLength = USB_STRING_LEN(sizeof(SERIAL_NUMBER) - 1), + .bLength = sizeof(USBSTR(SERIAL_NUMBER)), .bDescriptorType = USBDESCR_STRING }, .bString = USBSTR(SERIAL_NUMBER) diff --git a/tmk_core/protocol/vusb/vusb.h b/tmk_core/protocol/vusb/vusb.h index b1ecc98f37..c5cb27ded6 100644 --- a/tmk_core/protocol/vusb/vusb.h +++ b/tmk_core/protocol/vusb/vusb.h @@ -118,8 +118,6 @@ typedef struct usbConfigurationDescriptor { #endif } __attribute__((packed)) usbConfigurationDescriptor_t; -#define USB_STRING_LEN(s) (sizeof(usbDescriptorHeader_t) + ((s) << 1)) - extern bool vusb_suspended; host_driver_t *vusb_driver(void); |