From b3ea2870b33ff3f6414d7689d4f452dd7313036d Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Thu, 25 Jul 2019 14:42:25 -0400 Subject: 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. --- usbh/src/lib.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'usbh') 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"); -- cgit v1.2.3