aboutsummaryrefslogtreecommitdiffstats
path: root/usbh/src/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usbh/src/device.rs')
-rw-r--r--usbh/src/device.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/usbh/src/device.rs b/usbh/src/device.rs
index aba3919..fd5c1a1 100644
--- a/usbh/src/device.rs
+++ b/usbh/src/device.rs
@@ -302,7 +302,7 @@ impl Device {
FSM::GetReport(0) => self.state = FSM::Steady,
FSM::GetReport(count) => {
- info!("+++ getting report {}", count);
+ debug!("+++ getting report {}", count);
// For now, just do an IN transfer to see if we can
// get some keyboard reports without further setup.
@@ -324,12 +324,11 @@ impl Device {
fn read_report(&mut self, pipe_table: &mut PipeTable, host: &mut usb::HOST, id: u8) {
if let Some(ref mut ep) = self.endpoints[id as usize] {
let mut pipe = pipe_table.pipe_for(host, ep);
- let mut buf: core::mem::MaybeUninit<[u8; 8]> = core::mem::MaybeUninit::uninit();
+ let mut buf: [u8; 8] = [0; 8];
match pipe.in_transfer(ep, &mut buf, 15, self.millis) {
- Ok(bytes_received) => {
- let tmp = unsafe { &(buf.assume_init())[..bytes_received] };
- info!("report {}: {:?}", id, tmp);
- }
+ Ok(bytes_received) => info!("report {}: {} - {:?}", id, bytes_received, buf),
+
+ Err(PipeErr::Flow) => return,
Err(e) => trace!("error {}: {:?}", id, e),
}