Skip to content

Commit e89d0d9

Browse files
committed
usb-device-hid: Reset to report protocol when HID report descriptor is requested.
So HID device will exit boot protocol mode when entering normal OS. Signed-off-by: Hyx <[email protected]>
1 parent 862153f commit e89d0d9

File tree

1 file changed

+2
-0
lines changed
  • micropython/usb/usb-device-hid/usb/device

1 file changed

+2
-0
lines changed

micropython/usb/usb-device-hid/usb/device/hid.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ def on_interface_control_xfer(self, stage, request):
206206
if desc_type == _DESC_HID_TYPE:
207207
return self.get_hid_descriptor()
208208
if desc_type == _DESC_REPORT_TYPE:
209+
# Reset to report protocol when report descriptor is requested
210+
self.protocol = 1
209211
return self.report_descriptor
210212
elif req_type == _REQ_TYPE_CLASS:
211213
# HID Spec p50: 7.2 Class-Specific Requests

0 commit comments

Comments
 (0)