Skip to content

usb-device-mouse: Fix missing timeout on send_report. - #1186

Open
projectgus wants to merge 1 commit into
micropython:masterfrom
projectgus:bugfix/mouse_report_timeout
Open

projectgus wants to merge 1 commit into
micropython:masterfrom
projectgus:bugfix/mouse_report_timeout

Conversation

@projectgus

Copy link
Copy Markdown
Contributor

Summary

Implemented by refactoring out the wait_idle() logic in usb-device-hid. Closes #1178.

Timeout logic ensures that _buf is always updated even on a timeout, meaning that if the host does later read the mouse status then it gets the latest status not an old status.

Testing

Ran the mouse_example.py and keyboard_hello_example.py examples on Linux, ensured no regression. Have not tested in a boot environment as per the issue report.

Generative AI

I did not use generative AI tools when creating this PR.

Implemented by refactoring out the wait_idle() logic in
usb-device-hid.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@projectgus

Copy link
Copy Markdown
Contributor Author

@Zosili I've submitted this as an alternative to #1182. Your PR also looks fine, but this one updates _buf even if the timeout triggers. Do you have any concerns with doing it this way instead?

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.

usb-device-mouse: send_report() blocks forever if the host never reads the mouse

1 participant