From fb45c6c269bb1440fdf8750bed875dfe973ca8bb Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 30 Jul 2019 14:13:17 -0400 Subject: Only make three attempts to get the keyboard report. I'm tired of the spam, and three should be enough. --- usbh/src/device.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'usbh/src') diff --git a/usbh/src/device.rs b/usbh/src/device.rs index e77c9ea..aaf82d1 100644 --- a/usbh/src/device.rs +++ b/usbh/src/device.rs @@ -34,6 +34,7 @@ enum FSM { WaitForSettle(usize), GetConfigDescriptor, SetConfig, + GetReport(usize), Steady, } @@ -239,10 +240,14 @@ impl Device { )?; debug!(" -- report set: {}", rep_res); - self.state = FSM::Steady + self.state = FSM::GetReport(3) } - FSM::Steady => { + FSM::GetReport(0) => self.state = FSM::Steady, + + FSM::GetReport(count) => { + info!("+++ getting report {}", count); + // For now, just do an IN transfer to see if we can // get some keyboard reports without further setup. @@ -261,7 +266,11 @@ impl Device { //let mut pipe = pipe_table.pipe_for(host, self.addr, 2); //pipe.regs.cfg.write(|w| unsafe { w.ptype().bits(0x4) }); //self.read_report(&mut pipe, 2); + + self.state = FSM::GetReport(count - 1) } + + FSM::Steady => {} } Ok(()) } -- cgit v1.2.3