diff options
Diffstat (limited to 'usbh/src/device.rs')
-rw-r--r-- | usbh/src/device.rs | 13 |
1 files changed, 11 insertions, 2 deletions
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(()) } |