aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-08-10 19:41:05 -0400
committerBrian Cully <bjc@kublai.com>2019-08-10 19:41:05 -0400
commitd12984e27070d6e44841c1b22c31f235d7c27886 (patch)
tree93bed8b134fc1ab19eb4d4644a5e3aefd17d1789
parentba894eb475fbf1c5e744531057ed63ffcb1e8afc (diff)
downloadbootkbd-d12984e27070d6e44841c1b22c31f235d7c27886.tar.gz
bootkbd-d12984e27070d6e44841c1b22c31f235d7c27886.zip
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.
-rw-r--r--src/lib.rs10
1 files 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.