Fix TeensyHID bootloader - change vendor page in the descriptors to match the undocumented page needed for the new Teensy 2.0 boards.

Commit for the 091223 release.
pull/1469/head
Dean Camera 15 years ago
parent 24f730fce3
commit df31b1fd5b

@ -46,7 +46,7 @@
USB_Descriptor_HIDReport_Datatype_t HIDReport[] = USB_Descriptor_HIDReport_Datatype_t HIDReport[] =
{ {
0x06, 0x9c, 0xff, /* Usage Page (Vendor Defined) */ 0x06, 0x9c, 0xff, /* Usage Page (Vendor Defined) */
0x09, 0x19, /* Usage (Vendor Defined) */ 0x09, 0x1B, /* Usage (Vendor Defined) */
0xa1, 0x01, /* Collection (Vendor Defined) */ 0xa1, 0x01, /* Collection (Vendor Defined) */
0x0a, 0x19, 0x00, /* Usage (Vendor Defined) */ 0x0a, 0x19, 0x00, /* Usage (Vendor Defined) */
0x75, 0x08, /* Report Size (8) */ 0x75, 0x08, /* Report Size (8) */
@ -78,7 +78,7 @@ USB_Descriptor_Device_t DeviceDescriptor =
.ReleaseNumber = 0x0120, .ReleaseNumber = 0x0120,
.ManufacturerStrIndex = NO_DESCRIPTOR, .ManufacturerStrIndex = NO_DESCRIPTOR,
.ProductStrIndex = 0x01, .ProductStrIndex = NO_DESCRIPTOR,
.SerialNumStrIndex = NO_DESCRIPTOR, .SerialNumStrIndex = NO_DESCRIPTOR,
.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
@ -144,28 +144,6 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor =
}, },
}; };
/** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests
* the string descriptor with index 0 (the first index). It is actually an array of 16-bit integers, which indicate
* via the language ID table available at USB.org what languages the device supports for its string descriptors.
*/
USB_Descriptor_String_t LanguageString =
{
.Header = {.Size = USB_STRING_LEN(1), .Type = DTYPE_String},
.UnicodeString = {LANGUAGE_ID_ENG}
};
/** Product descriptor string. This is a Unicode string containing the product's details in human readable form,
* and is read out upon request by the host when the appropriate string ID is requested, listed in the Device
* Descriptor.
*/
USB_Descriptor_String_t ProductString =
{
.Header = {.Size = USB_STRING_LEN(21), .Type = DTYPE_String},
.UnicodeString = L"AVR Teensy Bootloader"
};
/** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors" /** This function is called by the library when in device mode, and must be overridden (see library "USB Descriptors"
* documentation) by the application code so that the address and size of a requested descriptor can be given * documentation) by the application code so that the address and size of a requested descriptor can be given
* to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function
@ -175,7 +153,6 @@ USB_Descriptor_String_t ProductString =
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
{ {
const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorType = (wValue >> 8);
const uint8_t DescriptorNumber = (wValue & 0xFF);
void* Address = NULL; void* Address = NULL;
uint16_t Size = NO_DESCRIPTOR; uint16_t Size = NO_DESCRIPTOR;
@ -189,19 +166,6 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex,
case DTYPE_Configuration: case DTYPE_Configuration:
Address = (void*)&ConfigurationDescriptor; Address = (void*)&ConfigurationDescriptor;
Size = sizeof(USB_Descriptor_Configuration_t); Size = sizeof(USB_Descriptor_Configuration_t);
break;
case DTYPE_String:
if (!(DescriptorNumber))
{
Address = (void*)&LanguageString;
Size = LanguageString.Header.Size;
}
else
{
Address = (void*)&ProductString;
Size = ProductString.Header.Size;
}
break; break;
case DTYPE_HID: case DTYPE_HID:
Address = (void*)&ConfigurationDescriptor.HIDDescriptor; Address = (void*)&ConfigurationDescriptor.HIDDescriptor;

@ -10,10 +10,7 @@
* *
* The following list indicates what microcontrollers are compatible with this demo. * The following list indicates what microcontrollers are compatible with this demo.
* *
* - AT90USB162 * - ATMEGA32U4 (Teensy 2.0)
* - ATMEGA32U4
* - AT90USB646
* - AT90USB1286
* *
* \section SSec_Info USB Information: * \section SSec_Info USB Information:
* *

@ -122,7 +122,7 @@ LUFA_PATH = ../..
# LUFA library compile-time options # LUFA library compile-time options
LUFA_OPTS = -D USB_DEVICE_ONLY LUFA_OPTS = -D USB_DEVICE_ONLY
LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0 LUFA_OPTS += -D DEVICE_STATE_AS_GPIOR=0
LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=64
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_RAM_DESCRIPTORS LUFA_OPTS += -D USE_RAM_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"

Loading…
Cancel
Save