X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/253deb996f321c59c102a64e17f95d0b5b0a0e6d..e4cfd5208fdb51942ad8857dd5e1d96f5216f73b:/Bootloaders/TeensyHID/Descriptors.c diff --git a/Bootloaders/TeensyHID/Descriptors.c b/Bootloaders/TeensyHID/Descriptors.c index fc7f51c6c..b85bd7ae7 100644 --- a/Bootloaders/TeensyHID/Descriptors.c +++ b/Bootloaders/TeensyHID/Descriptors.c @@ -81,7 +81,7 @@ USB_Descriptor_Device_t DeviceDescriptor = .ProductStrIndex = 0x01, .SerialNumStrIndex = NO_DESCRIPTOR, - .NumberOfConfigurations = 1 + .NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS }; /** Configuration descriptor structure. This descriptor, located in FLASH memory, describes the usage @@ -128,7 +128,7 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor = .HIDSpec = VERSION_BCD(01.11), .CountryCode = 0x00, - .TotalHIDReports = 0x01, + .TotalHIDDescriptors = 1, .HIDReportType = DTYPE_Report, .HIDReportLength = sizeof(HIDReport) }, @@ -138,7 +138,7 @@ USB_Descriptor_Configuration_t ConfigurationDescriptor = .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | HID_EPNUM), - .Attributes = EP_TYPE_INTERRUPT, + .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, .PollingIntervalMS = 0x40 }, @@ -172,7 +172,7 @@ USB_Descriptor_String_t ProductString = * is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the * USB host. */ -uint16_t 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 DescriptorNumber = (wValue & 0xFF); @@ -183,32 +183,32 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c switch (DescriptorType) { case DTYPE_Device: - Address = DESCRIPTOR_ADDRESS(DeviceDescriptor); + Address = (void*)&DeviceDescriptor; Size = sizeof(USB_Descriptor_Device_t); break; case DTYPE_Configuration: - Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor); + Address = (void*)&ConfigurationDescriptor; Size = sizeof(USB_Descriptor_Configuration_t); break; case DTYPE_String: if (!(DescriptorNumber)) { - Address = DESCRIPTOR_ADDRESS(LanguageString); + Address = (void*)&LanguageString; Size = LanguageString.Header.Size; } else { - Address = DESCRIPTOR_ADDRESS(ProductString); + Address = (void*)&ProductString; Size = ProductString.Header.Size; } break; case DTYPE_HID: - Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.HIDDescriptor); + Address = (void*)&ConfigurationDescriptor.HIDDescriptor; Size = sizeof(USB_Descriptor_HID_t); break; case DTYPE_Report: - Address = DESCRIPTOR_ADDRESS(HIDReport); + Address = (void*)&HIDReport; Size = sizeof(HIDReport); break; }