diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-04-06 03:14:22 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-04-06 05:38:11 +0200 |
| commit | 22a47aeeb2bc9d459a6e83414632890164a7b448 (patch) | |
| tree | 294dac5c31fa1e46a88314e95d3dd5feeba4d20e /embassy-usb/src/control.rs | |
| parent | f6d11dfba56b2b04868e87a14d10395e1916306d (diff) | |
usb: abort control data in/out on reset or when receiving another SETUP.
This removes the horrible timeout hack.
Diffstat (limited to 'embassy-usb/src/control.rs')
| -rw-r--r-- | embassy-usb/src/control.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/embassy-usb/src/control.rs b/embassy-usb/src/control.rs index b15ba4463..7c46812bd 100644 --- a/embassy-usb/src/control.rs +++ b/embassy-usb/src/control.rs | |||
| @@ -295,7 +295,13 @@ impl<C: driver::ControlPipe> ControlPipe<C> { | |||
| 295 | .chain(need_zlp.then(|| -> &[u8] { &[] })); | 295 | .chain(need_zlp.then(|| -> &[u8] { &[] })); |
| 296 | 296 | ||
| 297 | while let Some(chunk) = chunks.next() { | 297 | while let Some(chunk) = chunks.next() { |
| 298 | self.control.data_in(chunk, chunks.size_hint().0 == 0).await; | 298 | match self.control.data_in(chunk, chunks.size_hint().0 == 0).await { |
| 299 | Ok(()) => {} | ||
| 300 | Err(e) => { | ||
| 301 | warn!("control accept_in failed: {:?}", e); | ||
| 302 | return; | ||
| 303 | } | ||
| 304 | } | ||
| 299 | } | 305 | } |
| 300 | } | 306 | } |
| 301 | 307 | ||
