Extract interface numbers into enums.
This commit is contained in:
parent
cd3aae87da
commit
9ef29ea229
125 changed files with 780 additions and 319 deletions
|
@ -120,7 +120,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
{
|
||||
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||
|
||||
.InterfaceNumber = 0x00,
|
||||
.InterfaceNumber = INTERFACE_ID_Keyboard,
|
||||
.AlternateSetting = 0x00,
|
||||
|
||||
.TotalEndpoints = 1,
|
||||
|
@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
|
|||
{
|
||||
.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
|
||||
|
||||
.InterfaceNumber = 0x01,
|
||||
.InterfaceNumber = INTERFACE_ID_Mouse,
|
||||
.AlternateSetting = 0x00,
|
||||
|
||||
.TotalEndpoints = 1,
|
||||
|
@ -269,28 +269,30 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
|
|||
|
||||
break;
|
||||
case HID_DTYPE_HID:
|
||||
if (!(wIndex))
|
||||
switch (wIndex)
|
||||
{
|
||||
Address = &ConfigurationDescriptor.HID1_KeyboardHID;
|
||||
Size = sizeof(USB_HID_Descriptor_HID_t);
|
||||
}
|
||||
else
|
||||
{
|
||||
Address = &ConfigurationDescriptor.HID2_MouseHID;
|
||||
Size = sizeof(USB_HID_Descriptor_HID_t);
|
||||
case INTERFACE_ID_Keyboard:
|
||||
Address = &ConfigurationDescriptor.HID1_KeyboardHID;
|
||||
Size = sizeof(USB_HID_Descriptor_HID_t);
|
||||
break;
|
||||
case INTERFACE_ID_Mouse:
|
||||
Address = &ConfigurationDescriptor.HID2_MouseHID;
|
||||
Size = sizeof(USB_HID_Descriptor_HID_t);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case HID_DTYPE_Report:
|
||||
if (!(wIndex))
|
||||
switch (wIndex)
|
||||
{
|
||||
Address = &KeyboardReport;
|
||||
Size = sizeof(KeyboardReport);
|
||||
}
|
||||
else
|
||||
{
|
||||
Address = &MouseReport;
|
||||
Size = sizeof(MouseReport);
|
||||
case INTERFACE_ID_Keyboard:
|
||||
Address = &KeyboardReport;
|
||||
Size = sizeof(KeyboardReport);
|
||||
break;
|
||||
case INTERFACE_ID_Mouse:
|
||||
Address = &MouseReport;
|
||||
Size = sizeof(MouseReport);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue