]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Output/pjrcUSB/avr/usb_keyboard_serial.h
Fixing descriptor bugs
[kiibohd-controller.git] / Output / pjrcUSB / avr / usb_keyboard_serial.h
index c6289276260a14e55c17d725cd763d2e90c2b23d..7b2c7209cb86b1e3b612b9e1b455574a9ee137a7 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef usb_keyboard_serial_h__
 #define usb_keyboard_serial_h__
 
+// ----- Includes -----
+
 // Compiler Includes
 #include <stdint.h>
 
@@ -40,6 +42,7 @@
 #include "output_com.h"
 
 
+
 // ----- Function Declarations -----
 
 // Basic USB Configuration
@@ -257,7 +260,7 @@ static const uint8_t PROGMEM device_descriptor[] = {
        18,                                     // bLength
        1,                                      // bDescriptorType
        0x00, 0x02,                             // bcdUSB
-       0,                                      // bDeviceClass
+       0x03,                                   // bDeviceClass - 0x03 = HID Class
        0,                                      // bDeviceSubClass
        0,                                      // bDeviceProtocol
        ENDPOINT0_SIZE,                         // bMaxPacketSize0
@@ -270,6 +273,16 @@ static const uint8_t PROGMEM device_descriptor[] = {
        1                                       // bNumConfigurations
 };
 
+// Specify only a single USB speed
+static const uint8_t PROGMEM device_qualifier_descriptor[] = {
+       0
+};
+
+// Disable USB debug descriptor
+static const uint8_t PROGMEM usb_debug_descriptor[] = {
+       0
+};
+
 // Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
 static const uint8_t PROGMEM keyboard_hid_report_desc[] = {
        // Keyboard Collection
@@ -497,7 +510,7 @@ static const uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
        9,                                      // bLength
        0x21,                                   // bDescriptorType
        0x11, 0x01,                             // bcdHID
-       33,                                     // bCountryCode - Setting to 0/Undefined
+       0,                                      // bCountryCode - Setting to 0/Undefined
        1,                                      // bNumDescriptors
        0x22,                                   // bDescriptorType
                                                // wDescriptorLength
@@ -635,6 +648,8 @@ static const struct descriptor_list_struct {
 } PROGMEM descriptor_list[] = {
        {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
        {0x0200, 0x0000, config1_descriptor, sizeof(config1_descriptor)},
+       {0x0600, 0x0000, device_qualifier_descriptor, sizeof(device_qualifier_descriptor)},
+       {0x0A00, 0x0000, usb_debug_descriptor, sizeof(usb_debug_descriptor)},
        {0x2200, KEYBOARD_INTERFACE, keyboard_hid_report_desc, sizeof(keyboard_hid_report_desc)},
        {0x2100, KEYBOARD_INTERFACE, config1_descriptor + KEYBOARD_HID_DESC_OFFSET, 9},
        {0x2200, KEYBOARD_NKRO_INTERFACE, keyboard_nkro_hid_report_desc, sizeof(keyboard_nkro_hid_report_desc)},
@@ -647,5 +662,6 @@ static const struct descriptor_list_struct {
 #define NUM_DESC_LIST (sizeof(descriptor_list)/sizeof(struct descriptor_list_struct))
 
 
+
 #endif // usb_keyboard_serial_h__