diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2022-05-12 18:14:48 +0200 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2022-05-12 18:14:48 +0200 |
commit | 5fd55f95293b50ea2899c621186146dcb2be7823 (patch) | |
tree | a8146a04eda2f256fe0809eec5054be541d1181b /embassy-nrf | |
parent | 30d4d0e9d78681e16a68ff953c61b96c9863bfc6 (diff) | |
download | embassy-5fd55f95293b50ea2899c621186146dcb2be7823.zip |
usb: parse request in embassy-usb instead of the driver.
Diffstat (limited to 'embassy-nrf')
-rw-r--r-- | embassy-nrf/src/usb.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/embassy-nrf/src/usb.rs b/embassy-nrf/src/usb.rs index 1162946a..9dedc471 100644 --- a/embassy-nrf/src/usb.rs +++ b/embassy-nrf/src/usb.rs @@ -9,7 +9,6 @@ use embassy::interrupt::InterruptExt; use embassy::util::Unborrow; use embassy::waitqueue::AtomicWaker; use embassy_hal_common::unborrow; -use embassy_usb::control::Request; use embassy_usb::driver::{self, EndpointError, Event, Unsupported}; use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; use futures::future::poll_fn; @@ -682,14 +681,7 @@ impl<'d, T: Instance> driver::ControlPipe for ControlPipe<'d, T> { buf[6] = regs.wlengthl.read().wlengthl().bits(); buf[7] = regs.wlengthh.read().wlengthh().bits(); - let req = Request::parse(&buf); - - if req.direction == UsbDirection::Out { - regs.tasks_ep0rcvout - .write(|w| w.tasks_ep0rcvout().set_bit()); - } - - req + buf } } @@ -697,6 +689,9 @@ impl<'d, T: Instance> driver::ControlPipe for ControlPipe<'d, T> { async move { let regs = T::regs(); + regs.tasks_ep0rcvout + .write(|w| w.tasks_ep0rcvout().set_bit()); + // Wait until ready regs.intenset.write(|w| { w.usbreset().set(); |