-
Notifications
You must be signed in to change notification settings - Fork 8.1k
usb: device_next: hid: allow to set polling period at runtime #94518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usb: device_next: hid: allow to set polling period at runtime #94518
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to spot any bug and compared with the USB HID standard (which I am new to) and did not spot any issue.
include/zephyr/usb/class/usbd_hid.h
Outdated
* different polling periods at runtime. Depends on Kconfig options | ||
* USBD_HID_SET_POLLING_PERIOD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* different polling periods at runtime. Depends on Kconfig options | |
* USBD_HID_SET_POLLING_PERIOD. | |
* different polling periods at runtime. | |
* | |
* @kconfig_dep{CONFIG_USBD_HID_SET_POLLING_PERIOD} |
4d37563
to
b6fdab8
Compare
@tmon-nordic please take another look |
int (*set_in_polling)(const struct device *dev, const unsigned int value); | ||
int (*set_out_polling)(const struct device *dev, const unsigned int value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why name it value
and not period_us
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think period_us
is a more descriptive name as well
b6fdab8
to
719f1fb
Compare
Do not register the device when the class instance has already been initialised. Fail on initialization if no HID device is registered. Signed-off-by: Johann Fischer <[email protected]>
Allow to set input or output report polling period at runtime. Signed-off-by: Johann Fischer <[email protected]>
Add an example of how to set the polling period at runtime. Signed-off-by: Johann Fischer <[email protected]>
719f1fb
to
86aea0a
Compare
rebased on main to address CI failure |
|
Allow to set input or output report polling period at runtime.