Skip to content
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_hid.c doesn't receive outgoing reports correctly #897

Open
davidgiven opened this issue Feb 17, 2023 · 1 comment
Open

usb_hid.c doesn't receive outgoing reports correctly #897

davidgiven opened this issue Feb 17, 2023 · 1 comment

Comments

@davidgiven
Copy link

In usb_hid.c:hidUSBDataSetup(), there's this code:

[code]
usb_generic_control_rx_setup(buffer->buffer, buffer->bufferSize, &(buffer->state));
buffer->state = HID_BUFFER_UNREAD;
[/code]

As far as I can tell, that assignment to buffer->state shouldn't be there. usb_generic_control_rx_setup() will set the state itself if the retrieval completes, and sometimes it doesn't. If it doesn't, hidUSBDataSetup() will be called again. However, if the assignment above is present, then the buffer will be marked as unread twice (and so picked up by the application twice).

It seems that just removing the assignment fixes things.

@stevstrong
Copy link
Collaborator

Hi, can you please post a pull request?

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

No branches or pull requests

2 participants