Skip to content

Commit 9f3759b

Browse files
author
kolten
committed
enable configuring the bInterval on hid devices
1 parent 6ae440a commit 9f3759b

File tree

1 file changed

+3
-1
lines changed
  • micropython/usb/usb-device-hid/usb/device

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def __init__(
6464
set_report_buf=None,
6565
protocol=_INTERFACE_PROTOCOL_NONE,
6666
interface_str=None,
67+
binterval=8,
6768
):
6869
# Construct a new HID interface.
6970
#
@@ -91,6 +92,7 @@ def __init__(
9192
self._set_report_buf = set_report_buf
9293
self.protocol = protocol
9394
self.interface_str = interface_str
95+
self.binterval = binterval
9496

9597
self._int_ep = None # set during enumeration
9698

@@ -150,7 +152,7 @@ def desc_cfg(self, desc, itf_num, ep_num, strs):
150152
# Add the typical single USB interrupt endpoint descriptor associated
151153
# with a HID interface.
152154
self._int_ep = ep_num | _EP_IN_FLAG
153-
desc.endpoint(self._int_ep, "interrupt", 8, 8)
155+
desc.endpoint(self._int_ep, "interrupt", 8, self.binterval)
154156

155157
self.idle_rate = 0
156158

0 commit comments

Comments
 (0)