Skip to content

Commit 8a230a6

Browse files
hyx0329dpgeorge
authored andcommitted
usb-device-hid: Use report protocol after report descriptor requested.
So HID device will exit boot protocol mode when entering normal OS. Signed-off-by: Hyx <hyx0329@outlook.com>
1 parent 9031aa3 commit 8a230a6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
metadata(version="0.1.1")
1+
metadata(version="0.1.2")
22
require("usb-device")
33
package("usb")

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

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

0 commit comments

Comments
 (0)