Skip to content

Fix 835 hid cleanup#837

Merged
hathach merged 3 commits into
masterfrom
fix-835-hid-cleanup
May 18, 2021
Merged

Fix 835 hid cleanup#837
hathach merged 3 commits into
masterfrom
fix-835-hid-cleanup

Conversation

@hathach
Copy link
Copy Markdown
Owner

@hathach hathach commented May 18, 2021

Describe the PR
Fix #835 and more

  • add tud_hid_n_interface_protocol()
  • rename tud_hid_n_boot_mode() to tud_hid_n_get_protocol()
  • rename tud_hid_boot_mode_cb() to tud_hid_set_protocol_cb()
  • use HID spec protocol value for get/set_protocol() instead of bool
  • add HID_PROTOCOL_BOOT/REPORT to avoid magic number 0,1
  • rename HID_PROTOCOL_NONE/KEYBOARD/MOUSE to HID_ITF_PROTOCOL_ to avoid
    confusion
  • rename itf to instance in multiple API to have a better meaning.

hathach added 3 commits May 18, 2021 12:32
- add tud_hid_n_interface_protocol()
- rename tud_hid_n_boot_mode() to  tud_hid_n_get_protocol()
- rename tud_hid_boot_mode_cb() to tud_hid_set_protocol_cb()
- add HID_PROTOCOL_BOOT/REPORT to avoid magic number 0,1
- rename HID_PROTOCOL_NONE/KEYBOARD/MOUSE to HID_ITF_PROTOCOL_ to avoid
confusion
@hathach
Copy link
Copy Markdown
Owner Author

hathach commented May 18, 2021

@dhalbert the value return by API get_protocol and in set_protocol is now follow HID spec, either as HID_PROTOCOL_BOOT/REPORT. Although the boot_mode() is easy for new user, the invert logic cause confusion for people that are familiar with HID. You should re-read the API() description.

image

@hathach hathach merged commit 4f84185 into master May 18, 2021
@hathach hathach deleted the fix-835-hid-cleanup branch May 18, 2021 05:58
@dhalbert
Copy link
Copy Markdown
Contributor

Thanks! This makes it consistent internally and externally, and having the names instead of a bool is great.

7FM pushed a commit to 7FM/tinyusb that referenced this pull request Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent signature of tud_hid_boot_mode_cb()

2 participants