From d12984e27070d6e44841c1b22c31f235d7c27886 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sat, 10 Aug 2019 19:41:05 -0400 Subject: Don't fail enumeration if we can't set the keyboard report. Just log a warning and proceed to polling for keyboard reports. This fixes the Model 01, which was failing this transaction. --- src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ec82ea2..b068451 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ #![no_std] -use log::{self, debug, error, info, trace, LevelFilter}; +use log::{self, debug, error, info, trace, warn, LevelFilter}; use usb_host::{ ConfigurationDescriptor, DescriptorType, DeviceDescriptor, Direction, Driver, DriverError, Endpoint, EndpointDescriptor, InterfaceDescriptor, RequestCode, RequestDirection, RequestKind, @@ -269,7 +269,7 @@ impl Device { DeviceState::SetReport => { let mut report: [u8; 1] = [0]; - host.control_transfer( + let res = host.control_transfer( &mut self.ep0, RequestType::from(( RequestDirection::HostToDevice, @@ -280,7 +280,11 @@ impl Device { WValue::from((0, 2)), 0, Some(&mut report), - )?; + ); + + if let Err(e) = res { + warn!("couldn't set report: {:?}", e) + } // If we made it this far, thins should be ok, so // throttle the logging. -- cgit v1.2.3