aboutsummaryrefslogtreecommitdiffstats
path: root/usbh
diff options
context:
space:
mode:
Diffstat (limited to 'usbh')
-rwxr-xr-xusbh/src/lib.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/usbh/src/lib.rs b/usbh/src/lib.rs
index cbf9e66..8f6f0d8 100755
--- a/usbh/src/lib.rs
+++ b/usbh/src/lib.rs
@@ -1,4 +1,5 @@
#![no_std]
+#![allow(dead_code)]
mod pipe;
mod usbproto;
@@ -250,7 +251,7 @@ where
if let TaskState::Detached(_) = self.task_state {
self.task_state
} else {
-
+ TaskState::Detached(DetachedState::Initialize)
}
}
Event::Attached => {
@@ -412,11 +413,7 @@ where
)?;
let desc = vol_descr.get();
- info!(
- " -- len: {}, ver: {:04x}, bMaxPacketSize: {}, bNumConfigurations: {}",
- desc.b_length, desc.bcd_usb, desc.b_max_packet_size, desc.b_num_configurations
- );
- info!(" -- vid: {:x}, pid: {:x}", desc.id_vendor, desc.id_product);
+ info!(" -- devDesc: {:?}", desc);
// Assign address to this device and:
// - Stash bMaxPacketSize
@@ -436,8 +433,9 @@ where
let until = (self.millis)() + 300;
while (self.millis)() < until {}
- info!("getting config");
- let tmp: USBConfigurationDescriptor = Default::default();
+ info!("getting config with array");
+ //let tmp: USBConfigurationDescriptor = Default::default();
+ let tmp: [u8; 9] = [0; 9];
//let vol_descr = ::vcell::VolatileCell::new(tmp);
self.control_req(
new_address,
@@ -450,7 +448,7 @@ where
)?;
//let desc = vol_descr.get();
- info!("cdesc.len: {}", tmp.b_length);
+ info!("cdesc.len: {}, type: {}", tmp[0], tmp[1]);
// Once addressed, SET_CONFIGURATION(0)
info!("+++ setting configuration");