Repository navigation
Conversation
A host that never reads the interrupt endpoint leaves the first report pending, so the wait loop in MouseInterface.send_report() never finishes and every later call, including the ones from click_*() and move_by(), blocks the whole program. HIDInterface.send_report() has this timeout already, it was just never reached. The loop now gives up after timeout_ms and returns False without touching the report buffer, and the manifest version is bumped for the new argument. Signed-off-by: Zosili <zhx1005427725@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1178.
MouseInterface.send_report()waits for the previous report withwhile self.busy(): machine.idle()and no timeout, so a host that never readsthe interrupt endpoint leaves the first report pending and every later call,
including the ones from
click_*()andmove_by(), blocks the whole program.HIDInterface.send_report()has a 100 ms timeout for exactly this, it was justnever reached because the wait happens before calling it.
The loop now uses the same deadline and returns
Falsewithout touching_bufin that case, and
timeout_msis exposed as an argument, defaulting to 100 likethe base class. The manifest version is bumped for the new argument.
usb-device packages are not covered by
tools/ci.sh, so the check was a localstub harness that drives
machine.idle()and the endpoint state:send_report()returnsFalseafter the deadline andleaves the report buffer untouched (the unpatched code spins forever);
Falseas before.