|
|
@ -297,26 +297,26 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
|
|
|
|
switch (DescriptorType)
|
|
|
|
switch (DescriptorType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case DTYPE_Device:
|
|
|
|
case DTYPE_Device:
|
|
|
|
Address = DESCRIPTOR_ADDRESS(DeviceDescriptor);
|
|
|
|
Address = (void*)&DeviceDescriptor;
|
|
|
|
Size = sizeof(USB_Descriptor_Device_t);
|
|
|
|
Size = sizeof(USB_Descriptor_Device_t);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DTYPE_Configuration:
|
|
|
|
case DTYPE_Configuration:
|
|
|
|
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor);
|
|
|
|
Address = (void*)&ConfigurationDescriptor;
|
|
|
|
Size = sizeof(USB_Descriptor_Configuration_t);
|
|
|
|
Size = sizeof(USB_Descriptor_Configuration_t);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DTYPE_String:
|
|
|
|
case DTYPE_String:
|
|
|
|
switch (DescriptorNumber)
|
|
|
|
switch (DescriptorNumber)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 0x00:
|
|
|
|
case 0x00:
|
|
|
|
Address = DESCRIPTOR_ADDRESS(LanguageString);
|
|
|
|
Address = (void*)&LanguageString;
|
|
|
|
Size = pgm_read_byte(&LanguageString.Header.Size);
|
|
|
|
Size = pgm_read_byte(&LanguageString.Header.Size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 0x01:
|
|
|
|
case 0x01:
|
|
|
|
Address = DESCRIPTOR_ADDRESS(ManufacturerString);
|
|
|
|
Address = (void*)&ManufacturerString;
|
|
|
|
Size = pgm_read_byte(&ManufacturerString.Header.Size);
|
|
|
|
Size = pgm_read_byte(&ManufacturerString.Header.Size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 0x02:
|
|
|
|
case 0x02:
|
|
|
|
Address = DESCRIPTOR_ADDRESS(ProductString);
|
|
|
|
Address = (void*)&ProductString;
|
|
|
|
Size = pgm_read_byte(&ProductString.Header.Size);
|
|
|
|
Size = pgm_read_byte(&ProductString.Header.Size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -325,24 +325,24 @@ uint16_t USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** c
|
|
|
|
case DTYPE_HID:
|
|
|
|
case DTYPE_HID:
|
|
|
|
if (!(wIndex))
|
|
|
|
if (!(wIndex))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.KeyboardHID);
|
|
|
|
Address = (void*)&ConfigurationDescriptor.KeyboardHID;
|
|
|
|
Size = sizeof(USB_Descriptor_HID_t);
|
|
|
|
Size = sizeof(USB_Descriptor_HID_t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Address = DESCRIPTOR_ADDRESS(ConfigurationDescriptor.MouseHID);
|
|
|
|
Address = (void*)&ConfigurationDescriptor.MouseHID;
|
|
|
|
Size = sizeof(USB_Descriptor_HID_t);
|
|
|
|
Size = sizeof(USB_Descriptor_HID_t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DTYPE_Report:
|
|
|
|
case DTYPE_Report:
|
|
|
|
if (!(wIndex))
|
|
|
|
if (!(wIndex))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Address = DESCRIPTOR_ADDRESS(KeyboardReport);
|
|
|
|
Address = (void*)&KeyboardReport;
|
|
|
|
Size = sizeof(KeyboardReport);
|
|
|
|
Size = sizeof(KeyboardReport);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Address = DESCRIPTOR_ADDRESS(MouseReport);
|
|
|
|
Address = (void*)&MouseReport;
|
|
|
|
Size = sizeof(MouseReport);
|
|
|
|
Size = sizeof(MouseReport);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|