X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/6865a7bc09e31d3bbebb33eefb6475c8713351bd..189d0c7e669b6a3d07ed35c1eaa0bfc8cbc7a729:/Bootloaders/TeensyHID/Descriptors.c diff --git a/Bootloaders/TeensyHID/Descriptors.c b/Bootloaders/TeensyHID/Descriptors.c index 508dfb73a..99db8cac5 100644 --- a/Bootloaders/TeensyHID/Descriptors.c +++ b/Bootloaders/TeensyHID/Descriptors.c @@ -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) }, @@ -166,13 +166,13 @@ USB_Descriptor_String_t ProductString = .UnicodeString = L"AVR Teensy Bootloader" }; -/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h +/** 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 * to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function * 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; }