diff options
author | Brian Cully <bjc@kublai.com> | 2019-07-23 19:40:47 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-07-23 20:11:19 -0400 |
commit | 7f6c2b4d124864a2f0d7b0a91b8c4721d954fa6e (patch) | |
tree | f6f8d40e68c09f6250228b845a7885c97aee5fa8 /app | |
parent | 63d4ce8154eb8f6feb67986e98ea9b5007632460 (diff) | |
download | samd21-demo-7f6c2b4d124864a2f0d7b0a91b8c4721d954fa6e.tar.gz samd21-demo-7f6c2b4d124864a2f0d7b0a91b8c4721d954fa6e.zip |
test adding config get. doesn't work.
Diffstat (limited to 'app')
-rw-r--r-- | app/src/usb.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/src/usb.rs b/app/src/usb.rs index c15e1b5..acb4457 100644 --- a/app/src/usb.rs +++ b/app/src/usb.rs @@ -1,7 +1,7 @@ mod pipe; mod usbproto; -use crate::{log, logln, logln_now, rtc}; +use crate::{log, log_now, logln, logln_now, rtc}; use pipe::{DataBuf, PipeErr, PipeTable, USBPipeType, USBToken}; use rb::{Reader, RingBuffer, Writer}; use usbproto::*; @@ -430,6 +430,22 @@ impl USBHost { let until = rtc::millis() + 300; while rtc::millis() < until {} + logln_now!("getting config"); + let tmp: USBConfigurationDescriptor = Default::default(); + //let vol_descr = ::vcell::VolatileCell::new(tmp); + self.control_req( + new_address, + 0, + BMRequestType::get_descr(), + USBRequest::GetConfiguration, + WValue::from((0, 0)), + 0, + Some(DataBuf::from(&tmp)), + )?; + + //let desc = vol_descr.get(); + logln_now!("cdesc.len: {}", tmp.b_length); + // Once addressed, SET_CONFIGURATION(0) logln_now!("+++ setting configuration"); let conf: u8 = 0; |