From 7f6c2b4d124864a2f0d7b0a91b8c4721d954fa6e Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 23 Jul 2019 19:40:47 -0400 Subject: test adding config get. doesn't work. --- app/src/usb.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app') 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; -- cgit v1.2.3