@@ -29,7 +29,7 @@ struct hid_s
2929 uep_t ep_in ;
3030 uep_t ep_out ;
3131 int status ;
32- rt_uint16_t protocol ;
32+ rt_uint8_t protocol ;
3333 rt_uint8_t report_buf [MAX_REPORT_SIZE ];
3434 struct rt_messagequeue hid_mq ;
3535};
@@ -246,7 +246,7 @@ static struct udevice_descriptor _dev_desc =
246246 USB_DESC_LENGTH_DEVICE , //bLength;
247247 USB_DESC_TYPE_DEVICE , //type;
248248 USB_BCD_VERSION , //bcdUSB;
249- USB_CLASS_HID , //bDeviceClass;
249+ 0x0 , //bDeviceClass;
250250 0x00 , //bDeviceSubClass;
251251 0x00 , //bDeviceProtocol;
252252 64 , //bMaxPacketSize0;
@@ -266,8 +266,8 @@ static struct usb_qualifier_descriptor dev_qualifier =
266266 sizeof (dev_qualifier ), //bLength
267267 USB_DESC_TYPE_DEVICEQUALIFIER , //bDescriptorType
268268 0x0200 , //bcdUSB
269- USB_CLASS_MASS_STORAGE , //bDeviceClass
270- 0x06 , //bDeviceSubClass
269+ 0x0 , //bDeviceClass
270+ 0x0 , //bDeviceSubClass
271271 0x50 , //bDeviceProtocol
272272 64 , //bMaxPacketSize0
273273 0x01 , //bNumConfigurations
@@ -347,7 +347,7 @@ const static struct uhid_comm_descriptor _hid_comm_desc =
347347 USB_DYNAMIC | USB_DIR_IN ,
348348 USB_EP_ATTR_INT ,
349349 0x40 ,
350- 0x01 ,
350+ 0x0A ,
351351 },
352352
353353 /* Endpoint Descriptor OUT */
@@ -458,6 +458,7 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup)
458458
459459 struct hid_s * data = (struct hid_s * ) func -> user_data ;
460460
461+
461462 switch (setup -> bRequest )
462463 {
463464 case USB_REQ_GET_DESCRIPTOR :
@@ -486,7 +487,7 @@ static rt_err_t _interface_handler(ufunction_t func, ureq_t setup)
486487 dcd_ep0_send_status (func -> device -> dcd );
487488 break ;
488489 case USB_HID_REQ_GET_PROTOCOL :
489- rt_usbd_ep0_write (func -> device , & data -> protocol ,2 );
490+ rt_usbd_ep0_write (func -> device , & data -> protocol ,1 );
490491 break ;
491492 case USB_HID_REQ_SET_REPORT :
492493
@@ -692,8 +693,9 @@ ufunction_t rt_usbd_function_hid_create(udevice_t device)
692693
693694 /* create a cdc function */
694695 func = rt_usbd_function_new (device , & _dev_desc , & ops );
695- //not support hs
696- //rt_usbd_device_set_qualifier(device, &_dev_qualifier);
696+
697+ /* For high speed mode supporting */
698+ rt_usbd_device_set_qualifier (device , & dev_qualifier );
697699
698700 /* allocate memory for cdc vcom data */
699701 data = (struct hid_s * )rt_malloc (sizeof (struct hid_s ));
0 commit comments