aboutsummaryrefslogtreecommitdiffstats
path: root/usbh
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-07-25 14:42:25 -0400
committerBrian Cully <bjc@kublai.com>2019-07-25 14:43:31 -0400
commitb3ea2870b33ff3f6414d7689d4f452dd7313036d (patch)
tree61e3e7ba06578a23d23c95ec36782aa8a32be55a /usbh
parentce048a1594ee59d52eb66e6bd46d98b29e0f976a (diff)
downloadsamd21-demo-b3ea2870b33ff3f6414d7689d4f452dd7313036d.tar.gz
samd21-demo-b3ea2870b33ff3f6414d7689d4f452dd7313036d.zip
Allow dead code in crate.
We have to stub out a lot of stuff from USB protocol and hardware, and it may or may not get used, so quash the warning.
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");