From f242e68961d5c50c4e252b6bd965efd8f8a5c4f7 Mon Sep 17 00:00:00 2001 From: Ian Rees Date: Thu, 24 Jun 2021 16:31:53 +1200 Subject: [PATCH] Remove redundant & commented-out debug code --- hal/src/thumbv6m/usb/bus.rs | 6 +----- hal/src/thumbv7em/usb/bus.rs | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hal/src/thumbv6m/usb/bus.rs b/hal/src/thumbv6m/usb/bus.rs index c718ada23248..d10d7ad738bc 100644 --- a/hal/src/thumbv6m/usb/bus.rs +++ b/hal/src/thumbv6m/usb/bus.rs @@ -979,19 +979,14 @@ impl Inner { bank.clear_received_setup_interrupt(); } - // self.print_epstatus(idx, "read"); - bank.clear_transfer_complete(); if buf.len() != 0 { bank.set_ready(false); } - drop(bank); - match size { Ok(size) => { - //dbgprint!("UsbBus::read {} bytes ok", size); dbgprint!( "UsbBus::read {} bytes from ep {:?} -> {:?}\n", size, @@ -1002,6 +997,7 @@ impl Inner { } Err(err) => { dbgprint!("UsbBus::read from ep {:?} -> {:?}\n", ep, err); + drop(bank); // bank holds a reference to self.desc, which print_epstatus() needs self.print_epstatus(ep.index(), "after read"); Err(err) } diff --git a/hal/src/thumbv7em/usb/bus.rs b/hal/src/thumbv7em/usb/bus.rs index 6f04f4184928..9c8f8461a8a8 100644 --- a/hal/src/thumbv7em/usb/bus.rs +++ b/hal/src/thumbv7em/usb/bus.rs @@ -925,19 +925,14 @@ impl Inner { bank.clear_received_setup_interrupt(); } - // self.print_epstatus(idx, "read"); - bank.clear_transfer_complete(); if buf.len() != 0 { bank.set_ready(false); } - drop(bank); - match size { Ok(size) => { - //dbgprint!("UsbBus::read {} bytes ok", size); dbgprint!( "UsbBus::read {} bytes from ep {:?} -> {:?}\n", size, @@ -948,6 +943,7 @@ impl Inner { } Err(err) => { dbgprint!("UsbBus::read from ep {:?} -> {:?}\n", ep, err); + drop(bank); // bank holds a reference to self.desc, which print_epstatus() needs self.print_epstatus(ep.index(), "after read"); Err(err) }