diff options
| author | alexmoon <[email protected]> | 2022-04-07 10:49:50 -0400 |
|---|---|---|
| committer | alexmoon <[email protected]> | 2022-04-07 10:54:21 -0400 |
| commit | 7f9dd1a37b98272da1adef376df4bd3c805b6101 (patch) | |
| tree | 620b9a199928c6d955d2ad2886f5184857e55291 | |
| parent | 6abbfa9a92ec9feb03e30846bccb66272020601d (diff) | |
Fix spurious ControlPipe::data_in errors
| -rw-r--r-- | embassy-nrf/src/usb.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-nrf/src/usb.rs b/embassy-nrf/src/usb.rs index 0fcbe025d..9f483d96e 100644 --- a/embassy-nrf/src/usb.rs +++ b/embassy-nrf/src/usb.rs | |||
| @@ -662,14 +662,14 @@ impl<'d, T: Instance> driver::ControlPipe for ControlPipe<'d, T> { | |||
| 662 | poll_fn(|cx| { | 662 | poll_fn(|cx| { |
| 663 | EP0_WAKER.register(cx.waker()); | 663 | EP0_WAKER.register(cx.waker()); |
| 664 | let regs = T::regs(); | 664 | let regs = T::regs(); |
| 665 | if regs.events_usbreset.read().bits() != 0 { | 665 | if regs.events_ep0datadone.read().bits() != 0 { |
| 666 | Poll::Ready(Ok(())) | ||
| 667 | } else if regs.events_usbreset.read().bits() != 0 { | ||
| 666 | trace!("aborted control data_out: usb reset"); | 668 | trace!("aborted control data_out: usb reset"); |
| 667 | Poll::Ready(Err(ReadError::Disabled)) | 669 | Poll::Ready(Err(ReadError::Disabled)) |
| 668 | } else if regs.events_ep0setup.read().bits() != 0 { | 670 | } else if regs.events_ep0setup.read().bits() != 0 { |
| 669 | trace!("aborted control data_out: received another SETUP"); | 671 | trace!("aborted control data_out: received another SETUP"); |
| 670 | Poll::Ready(Err(ReadError::Disabled)) | 672 | Poll::Ready(Err(ReadError::Disabled)) |
| 671 | } else if regs.events_ep0datadone.read().bits() != 0 { | ||
| 672 | Poll::Ready(Ok(())) | ||
| 673 | } else { | 673 | } else { |
| 674 | Poll::Pending | 674 | Poll::Pending |
| 675 | } | 675 | } |
| @@ -701,14 +701,14 @@ impl<'d, T: Instance> driver::ControlPipe for ControlPipe<'d, T> { | |||
| 701 | cx.waker().wake_by_ref(); | 701 | cx.waker().wake_by_ref(); |
| 702 | EP0_WAKER.register(cx.waker()); | 702 | EP0_WAKER.register(cx.waker()); |
| 703 | let regs = T::regs(); | 703 | let regs = T::regs(); |
| 704 | if regs.events_usbreset.read().bits() != 0 { | 704 | if regs.events_ep0datadone.read().bits() != 0 { |
| 705 | Poll::Ready(Ok(())) | ||
| 706 | } else if regs.events_usbreset.read().bits() != 0 { | ||
| 705 | trace!("aborted control data_in: usb reset"); | 707 | trace!("aborted control data_in: usb reset"); |
| 706 | Poll::Ready(Err(WriteError::Disabled)) | 708 | Poll::Ready(Err(WriteError::Disabled)) |
| 707 | } else if regs.events_ep0setup.read().bits() != 0 { | 709 | } else if regs.events_ep0setup.read().bits() != 0 { |
| 708 | trace!("aborted control data_in: received another SETUP"); | 710 | trace!("aborted control data_in: received another SETUP"); |
| 709 | Poll::Ready(Err(WriteError::Disabled)) | 711 | Poll::Ready(Err(WriteError::Disabled)) |
| 710 | } else if regs.events_ep0datadone.read().bits() != 0 { | ||
| 711 | Poll::Ready(Ok(())) | ||
| 712 | } else { | 712 | } else { |
| 713 | Poll::Pending | 713 | Poll::Pending |
| 714 | } | 714 | } |
