Skip to content
Merged
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
2 changes: 2 additions & 0 deletions embassy-usb-synopsys-otg/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- next-header -->
## Unreleased - ReleaseDate

- Disabling an OUT endpoint no longer flushes the TX FIFO of the corresponding IN endpoint

## 0.3.1 - 2025-08-26

- Improve receive performance, more efficient copy from FIFO
Expand Down
26 changes: 13 additions & 13 deletions embassy-usb-synopsys-otg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,18 +945,6 @@ impl<'d, const MAX_EP_COUNT: usize> embassy_usb_driver::Bus for Bus<'d, MAX_EP_C
regs.doepctl(ep_addr.index()).modify(|w| {
w.set_usbaep(enabled);
});

// Flush tx fifo
regs.grstctl().write(|w| {
w.set_txfflsh(true);
w.set_txfnum(ep_addr.index() as _);
});
loop {
let x = regs.grstctl().read();
if !x.txfflsh() {
break;
}
}
});

// Wake `Endpoint::wait_enabled()`
Expand All @@ -975,7 +963,19 @@ impl<'d, const MAX_EP_COUNT: usize> embassy_usb_driver::Bus for Bus<'d, MAX_EP_C
regs.diepctl(ep_addr.index()).modify(|w| {
w.set_usbaep(enabled);
w.set_cnak(enabled); // clear NAK that might've been set by SNAK above.
})
});

// Flush tx fifo
regs.grstctl().write(|w| {
w.set_txfflsh(true);
w.set_txfnum(ep_addr.index() as _);
});
loop {
let x = regs.grstctl().read();
if !x.txfflsh() {
break;
}
}
});

// Wake `Endpoint::wait_enabled()`
Expand Down
Loading