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: fix enumeration issues by propagating buffer overflow error. #738

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hal/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased Changes

- Fix USB enumeration issues with fast host controllers
- Allow configuring USB clock with `GenericClockController` on atsamd11
- fix samd51j not having i2s support
- remove i2s functionality for samd51g since it does not have it
Expand Down
4 changes: 2 additions & 2 deletions hal/src/peripherals/usb/d11/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ impl Inner {
let rxstp = bank.received_setup_interrupt();

if bank.is_ready() || rxstp {
let size = bank.read(buf);
let size = bank.read(buf)?;

if rxstp {
bank.clear_received_setup_interrupt();
Expand All @@ -907,7 +907,7 @@ impl Inner {
bank.clear_transfer_complete();
bank.set_ready(false);

size
Ok(size)
} else {
Err(UsbError::WouldBlock)
}
Expand Down
4 changes: 2 additions & 2 deletions hal/src/peripherals/usb/d5x/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ impl Inner {
let rxstp = bank.received_setup_interrupt();

if bank.is_ready() || rxstp {
let size = bank.read(buf);
let size = bank.read(buf)?;

if rxstp {
bank.clear_received_setup_interrupt();
Expand All @@ -850,7 +850,7 @@ impl Inner {
bank.clear_transfer_complete();
bank.set_ready(false);

size
Ok(size)
} else {
Err(UsbError::WouldBlock)
}
Expand Down
Loading