Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion micropython/usb/usb-device-hid/usb/device/hid.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(
set_report_buf=None,
protocol=_INTERFACE_PROTOCOL_NONE,
interface_str=None,
binterval=8,
):
# Construct a new HID interface.
#
Expand All @@ -85,12 +86,15 @@ def __init__(
# - protocol can be set to a specific value as per HID v1.11 section 4.3 Protocols, p9.
#
# - interface_str is an optional string descriptor to associate with the HID USB interface.
#
# - binterval this is the polling rate the device will request the host use in milliseconds.
super().__init__()
self.report_descriptor = report_descriptor
self.extra_descriptors = extra_descriptors
self._set_report_buf = set_report_buf
self.protocol = protocol
self.interface_str = interface_str
self.binterval = binterval

self._int_ep = None # set during enumeration

Expand Down Expand Up @@ -150,7 +154,7 @@ def desc_cfg(self, desc, itf_num, ep_num, strs):
# Add the typical single USB interrupt endpoint descriptor associated
# with a HID interface.
self._int_ep = ep_num | _EP_IN_FLAG
desc.endpoint(self._int_ep, "interrupt", 8, 8)
desc.endpoint(self._int_ep, "interrupt", 8, self.binterval)

self.idle_rate = 0

Expand Down
Loading