aboutsummaryrefslogtreecommitdiffstats
path: root/usbh/src/device.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-07-30 18:26:10 -0400
committerBrian Cully <bjc@kublai.com>2019-07-30 18:26:10 -0400
commit7f3601e081f71776d3b5f9fc58d5e1adda7772a3 (patch)
tree2be13a2d22d590719d8828b83afbe6fa31eceba0 /usbh/src/device.rs
parentfb45c6c269bb1440fdf8750bed875dfe973ca8bb (diff)
downloadsamd21-demo-7f3601e081f71776d3b5f9fc58d5e1adda7772a3.tar.gz
samd21-demo-7f3601e081f71776d3b5f9fc58d5e1adda7772a3.zip
WIP: Holy smokes I read my first keyboard report.
Too bad it's still trfail town after the first, but progress!
Diffstat (limited to 'usbh/src/device.rs')
-rw-r--r--usbh/src/device.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/usbh/src/device.rs b/usbh/src/device.rs
index aaf82d1..6efc395 100644
--- a/usbh/src/device.rs
+++ b/usbh/src/device.rs
@@ -225,7 +225,7 @@ impl Device {
debug!(" -- idle set");
debug!("+++ setting report");
- let mut rep_res: u8 = 0;
+ let mut report: u8 = 0;
pipe.control_transfer(
RequestType::from((
RequestDirection::HostToDevice,
@@ -235,10 +235,10 @@ impl Device {
RequestCode::SetConfiguration,
WValue::from((0, 2)),
0,
- Some(&mut rep_res),
+ Some(&mut report),
self.millis,
)?;
- debug!(" -- report set: {}", rep_res);
+ debug!(" -- report set");
self.state = FSM::GetReport(3)
}
@@ -276,7 +276,7 @@ impl Device {
}
fn read_report(&mut self, pipe: &mut Pipe, id: u8) {
- let mut buf: core::mem::MaybeUninit<[u8; 64]> = core::mem::MaybeUninit::uninit();
+ let mut buf: core::mem::MaybeUninit<[u8; 8]> = core::mem::MaybeUninit::uninit();
match pipe.in_transfer(&mut buf, 15, self.millis) {
Ok(bytes_received) => {
let tmp = unsafe { &(buf.assume_init())[..bytes_received] };