-
Notifications
You must be signed in to change notification settings - Fork 687
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
sam4l: usb: handle return code, long buffers #1894
Conversation
This was split off from `Ok`, but not added to the return code handler for the SAM4L. Kinda feel like this one is on Rust, since it shouldn't compile without handling this case :(.
As far as I can tell, we only ever use the pointer address for these buffers, and not their length, so it should be fine if the buffers are too long (say 64 bytes rather than 8, as the capsule uses).
OkSetAddress
return code
Unblocked, I forgot I had to look into the 64 vs. 8 byte buffer issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two places in handle_ctrl_endpoint_interrupt
where packet_bytes == 8
is used. I think the latter (for transfer_complete
) should be changed to 64. I'm not sure about the former.
Buffer size increased from 8 to 64.
Ok yup I agree. The first one I think is an "extra" check, because the received packet is always 8 bytes. We could remove the check, but it would fail if we set it to 64. |
bors r+ |
OkSetAddress
return type was split off fromOk
, but not added to the return code handler for the SAM4L. This puts it back.Testing Strategy
This pull request was tested by running the usb test on imix and verifying that my laptop recognizes the USB device.
TODO or Help Wanted
n/a
Documentation Updated
/docs
, or no updates are required.Formatting
make format
.make clippy
.