Skip to content

Conversation

jfischer-no
Copy link
Contributor

Allow to set input or output report polling period at runtime.

@jfischer-no jfischer-no self-assigned this Aug 14, 2025
@jfischer-no jfischer-no added the area: USB Universal Serial Bus label Aug 14, 2025
@zephyrbot zephyrbot added the area: Samples Samples label Aug 14, 2025
@zephyrbot zephyrbot requested review from kartben and nashif August 14, 2025 21:07
josuah
josuah previously approved these changes Aug 19, 2025
Copy link
Contributor

@josuah josuah left a 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.

Comment on lines 219 to 220
* different polling periods at runtime. Depends on Kconfig options
* USBD_HID_SET_POLLING_PERIOD.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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}

@carlescufi
Copy link
Member

@tmon-nordic please take another look

Comment on lines 23 to 24
int (*set_in_polling)(const struct device *dev, const unsigned int value);
int (*set_out_polling)(const struct device *dev, const unsigned int value);
Copy link
Contributor

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?

Copy link
Member

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

@jfischer-no jfischer-no force-pushed the pr-device_next_hid_binterval branch from b6fdab8 to 719f1fb Compare October 1, 2025 13:59
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]>
@kartben kartben force-pushed the pr-device_next_hid_binterval branch from 719f1fb to 86aea0a Compare October 20, 2025 13:27
@kartben
Copy link
Contributor

kartben commented Oct 20, 2025

rebased on main to address CI failure

Copy link

@cfriedt cfriedt merged commit e295a38 into zephyrproject-rtos:main Oct 20, 2025
34 of 36 checks passed
@jfischer-no jfischer-no deleted the pr-device_next_hid_binterval branch October 21, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Samples Samples area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants