From 9a85f92a4373ae2d9283035964c4cf1c7b41bcc9 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Sun, 28 Sep 2014 16:42:43 -0700 Subject: [PATCH] Fixing descriptor bugs - Missing device qualifier descriptor - Missing USB Debug descriptor (used by lsusb) --- Output/pjrcUSB/avr/usb_keyboard_serial.c | 4 ++-- Output/pjrcUSB/avr/usb_keyboard_serial.h | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Output/pjrcUSB/avr/usb_keyboard_serial.c b/Output/pjrcUSB/avr/usb_keyboard_serial.c index e61cc6d..63a8f72 100644 --- a/Output/pjrcUSB/avr/usb_keyboard_serial.c +++ b/Output/pjrcUSB/avr/usb_keyboard_serial.c @@ -865,7 +865,7 @@ ISR( USB_COM_vect ) USBKeys_Idle_Config = (wValue >> 8); USBKeys_Idle_Count = 0; usb_send_in(); - print("HID IDLE"); + //print("HID IDLE"); return; } if ( bRequest == HID_SET_PROTOCOL ) @@ -873,7 +873,7 @@ ISR( USB_COM_vect ) usb_wait_in_ready(); USBKeys_Protocol = wValue; // 0 - Boot Mode, 1 - NKRO Mode usb_send_in(); - print("HID SET"); + //print("HID SET"); return; } } diff --git a/Output/pjrcUSB/avr/usb_keyboard_serial.h b/Output/pjrcUSB/avr/usb_keyboard_serial.h index ae9e134..7b2c720 100644 --- a/Output/pjrcUSB/avr/usb_keyboard_serial.h +++ b/Output/pjrcUSB/avr/usb_keyboard_serial.h @@ -273,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 @@ -500,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 @@ -638,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)},