mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-03 07:21:36 +00:00
fix boot mouse descriptor issue
This commit is contained in:
parent
a6fede4962
commit
67e52af936
@ -325,9 +325,9 @@ static void usbd_reset(uint8_t rhport)
|
|||||||
tud_desc_set.hid_report.boot_keyboard = _desc_auto_hid_kbd_report;
|
tud_desc_set.hid_report.boot_keyboard = _desc_auto_hid_kbd_report;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUD_HID_MOUSE && CFG_TUD_HID_BOOT_PROTOCOL
|
#if CFG_TUD_HID_MOUSE
|
||||||
extern uint8_t const _desc_auto_hid_mse_report[];
|
extern uint8_t const _desc_auto_hid_mse_report[];
|
||||||
tud_desc_set.hid_report.boot_mouse = _desc_auto_hid_kbd_report;
|
tud_desc_set.hid_report.boot_mouse = _desc_auto_hid_mse_report;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -353,6 +353,8 @@ static tusb_error_t proc_control_request_st(uint8_t rhport, tusb_control_request
|
|||||||
error = TUSB_ERROR_NONE;
|
error = TUSB_ERROR_NONE;
|
||||||
|
|
||||||
//------------- Standard Request e.g in enumeration -------------//
|
//------------- Standard Request e.g in enumeration -------------//
|
||||||
|
/* Microsoft Windows will awkwardly get HID Report Descriptor with
|
||||||
|
* Recipient = Device instead of Interface */
|
||||||
if( TUSB_REQ_RCPT_DEVICE == p_request->bmRequestType_bit.recipient &&
|
if( TUSB_REQ_RCPT_DEVICE == p_request->bmRequestType_bit.recipient &&
|
||||||
TUSB_REQ_TYPE_STANDARD == p_request->bmRequestType_bit.type )
|
TUSB_REQ_TYPE_STANDARD == p_request->bmRequestType_bit.type )
|
||||||
{
|
{
|
||||||
@ -518,6 +520,9 @@ static uint16_t get_descriptor(uint8_t rhport, tusb_control_request_t const * co
|
|||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
// out of range
|
// out of range
|
||||||
|
/* The 0xee string is indeed a Microsoft USB extension.
|
||||||
|
* It can be used to tell Windows what driver it should use for the device !!!
|
||||||
|
*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
// Keyboard Report Descriptor
|
// Keyboard Report Descriptor
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
#if CFG_TUD_HID_KEYBOARD
|
#if CFG_TUD_HID_KEYBOARD
|
||||||
uint8_t const _desc_auto_hid_kbd_report[] = {
|
ATTR_PACKED uint8_t const _desc_auto_hid_kbd_report[] = {
|
||||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
||||||
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
|
HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ),
|
||||||
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
|
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
|
||||||
@ -170,7 +170,7 @@ uint8_t const _desc_auto_hid_kbd_report[] = {
|
|||||||
// Mouse Report Descriptor
|
// Mouse Report Descriptor
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
#if CFG_TUD_HID_MOUSE
|
#if CFG_TUD_HID_MOUSE
|
||||||
uint8_t const _desc_auto_hid_mse_report[] = {
|
ATTR_PACKED uint8_t const _desc_auto_hid_mse_report[] = {
|
||||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
||||||
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
|
HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ),
|
||||||
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
|
HID_COLLECTION ( HID_COLLECTION_APPLICATION ),
|
||||||
@ -189,8 +189,8 @@ uint8_t const _desc_auto_hid_mse_report[] = {
|
|||||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ),
|
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ),
|
||||||
|
|
||||||
// 3 bit padding
|
// 3 bit padding
|
||||||
HID_REPORT_SIZE ( 3 ),
|
|
||||||
HID_REPORT_COUNT ( 1 ),
|
HID_REPORT_COUNT ( 1 ),
|
||||||
|
HID_REPORT_SIZE ( 3 ),
|
||||||
HID_INPUT ( HID_CONSTANT ),
|
HID_INPUT ( HID_CONSTANT ),
|
||||||
|
|
||||||
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ),
|
||||||
@ -202,18 +202,17 @@ uint8_t const _desc_auto_hid_mse_report[] = {
|
|||||||
|
|
||||||
HID_REPORT_COUNT ( 2 ),
|
HID_REPORT_COUNT ( 2 ),
|
||||||
HID_REPORT_SIZE ( 8 ),
|
HID_REPORT_SIZE ( 8 ),
|
||||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ), /* relative values */
|
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ),
|
||||||
|
|
||||||
/* mouse scroll */
|
/* mouse scroll */
|
||||||
HID_USAGE ( HID_USAGE_DESKTOP_WHEEL ),
|
HID_USAGE ( HID_USAGE_DESKTOP_WHEEL ),
|
||||||
HID_LOGICAL_MIN ( 0x81 ), /* -127 */
|
HID_LOGICAL_MIN ( 0x81 ), /* -127 */
|
||||||
HID_LOGICAL_MAX ( 0x7f ), /* 127 */
|
HID_LOGICAL_MAX ( 0x7f ), /* 127 */
|
||||||
HID_REPORT_COUNT( 1 ),
|
HID_REPORT_COUNT( 1 ),
|
||||||
HID_REPORT_SIZE ( 8 ), /* 8-bit value */
|
HID_REPORT_SIZE ( 8 ),
|
||||||
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ), /* relative values */
|
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_RELATIVE ),
|
||||||
|
|
||||||
HID_COLLECTION_END,
|
HID_COLLECTION_END,
|
||||||
|
|
||||||
HID_COLLECTION_END
|
HID_COLLECTION_END
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@ -595,7 +594,7 @@ desc_auto_cfg_t const _desc_auto_config_struct =
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#if CFG_TUD_HID_KEYBOARD || CFG_TUD_HID_MOUSE
|
#if CFG_TUD_HID_KEYBOARD || CFG_TUD_HID_MOUSE
|
||||||
//------------- HID Keyboard + Mouse 9multiple reports) -------------//
|
//------------- HID Keyboard + Mouse (multiple reports) -------------//
|
||||||
.hid_composite =
|
.hid_composite =
|
||||||
{
|
{
|
||||||
.itf =
|
.itf =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user