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

Remove unnecessary input buffer #333

Merged
merged 2 commits into from
Jul 20, 2023
Merged

Remove unnecessary input buffer #333

merged 2 commits into from
Jul 20, 2023

Conversation

brghena
Copy link
Contributor

@brghena brghena commented Jul 20, 2023

Cleans up the USB Keyboard HID driver by no longer requiring an input buffer for sending strings or characters. Instead, make a local buffer on the stack and use that. The synchronous function that actually sends a buffer has not been changed.

When testing, I found that usb_keyboard_hid_send() would sometimes return ERESERVE . This behavior occurs in the original version as well before this commit. ERESERVE means either the buffer couldn't be taken, or something else couldn't unwrap (I can't follow that mess). https://github.com/tock/tock/blob/master/capsules/extra/src/usb_hid_driver.rs#L205-L231 However, HID output does appear correctly and the app keeps working, so I guess we can keep ignoring it for now...?

@bradjc bradjc merged commit 43bb0ae into master Jul 20, 2023
4 checks passed
@bors bors bot deleted the clean-usb-hid branch July 20, 2023 21:43
ppannuto added a commit to tock/tock that referenced this pull request Jul 21, 2023
The send path has two possible failures
 1. Userspace forgot to allow a buffer to send from
 2. The driver already sending something

Previously, we returned ERESERVE in both cases, but (2) should be
EBUSY instead, which this corrects.

I believe this will explain tock/libtock-c#333
brghena added a commit that referenced this pull request Jul 21, 2023
bradjc pushed a commit that referenced this pull request Jul 25, 2023
tyler-potyondy pushed a commit to tyler-potyondy/libtock-c that referenced this pull request Mar 13, 2024
Remove unnecessary input buffer
tyler-potyondy pushed a commit to tyler-potyondy/libtock-c that referenced this pull request Mar 13, 2024
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.

3 participants