Skip to content

Prevent tu_edpt_number() from returning an invalid endpoint number#3335

Merged
HiFiPhile merged 1 commit intohathach:masterfrom
ldube:master
Nov 14, 2025
Merged

Prevent tu_edpt_number() from returning an invalid endpoint number#3335
HiFiPhile merged 1 commit intohathach:masterfrom
ldube:master

Conversation

@ldube
Copy link
Contributor

@ldube ldube commented Nov 7, 2025

Describe the PR
The endpoint number is 4 bits wide. The original code extracts 7 bits.
~TUSB_DIR_IN_MASK is 0x7F but we need to use 0x0F.
It is safer not to assume that bits 4..6 of bEndpointAddress are zero.

Additional context
See the bEndpointAddress description in the following link.

EndpointDescriptors

@HiFiPhile
Copy link
Collaborator

Thank you !

@HiFiPhile HiFiPhile merged commit fc5415b into hathach:master Nov 14, 2025
84 of 87 checks passed
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.

2 participants