aboutsummaryrefslogtreecommitdiffstats
path: root/usbh/src/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'usbh/src/device.rs')
-rw-r--r--usbh/src/device.rs29
1 files changed, 14 insertions, 15 deletions
diff --git a/usbh/src/device.rs b/usbh/src/device.rs
index f300aa4..eeaa33b 100644
--- a/usbh/src/device.rs
+++ b/usbh/src/device.rs
@@ -1,4 +1,4 @@
-use super::pipe::{DataBuf, Pipe, PipeErr, PipeTable};
+use super::pipe::{Pipe, PipeErr, PipeTable};
use super::usbproto::*;
use core::convert::TryInto;
@@ -145,7 +145,7 @@ impl Device {
RequestCode::GetDescriptor,
WValue::from((0, DescriptorType::Device as u8)),
0,
- Some(DataBuf::from(&mut vol_descr)),
+ Some(&mut vol_descr),
self.millis,
)?;
@@ -167,7 +167,7 @@ impl Device {
RequestCode::GetDescriptor,
WValue::from((0, DescriptorType::Configuration as u8)),
0,
- Some(DataBuf::from(&mut vol_descr)),
+ Some(&mut vol_descr),
self.millis,
)?;
let desc = vol_descr.get();
@@ -182,7 +182,7 @@ impl Device {
RequestCode::GetDescriptor,
WValue::from((0, DescriptorType::Configuration as u8)),
0,
- Some(DataBuf::from(&mut tmp)),
+ Some(&mut tmp),
self.millis,
)?;
@@ -199,7 +199,7 @@ impl Device {
RequestCode::SetConfiguration,
WValue::from((conf, 0)),
0,
- None,
+ Option::<&mut ()>::None,
self.millis,
)?;
debug!(" -- configuration set");
@@ -207,14 +207,14 @@ impl Device {
debug!("+++ setting idle");
pipe.control_req(
RequestType::from((
- USBSetupDirection::HostToDevice,
- USBSetupType::Class,
- USBSetupRecipient::Interface,
+ RequestDirection::HostToDevice,
+ RequestKind::Class,
+ RequestRecipient::Interface,
)),
RequestCode::GetInterface, // This is also idle, but can't have two enums with the same value.
WValue::from((0, 0)),
0,
- None,
+ Option::<&mut ()>::None,
self.millis,
)?;
debug!(" -- idle set");
@@ -223,14 +223,14 @@ impl Device {
let mut rep_res: u8 = 0;
pipe.control_req(
RequestType::from((
- USBSetupDirection::HostToDevice,
- USBSetupType::Class,
- USBSetupRecipient::Interface,
+ RequestDirection::HostToDevice,
+ RequestKind::Class,
+ RequestRecipient::Interface,
)),
RequestCode::SetConfiguration,
WValue::from((0, 2)),
0,
- Some(DataBuf::from(&mut rep_res)),
+ Some(&mut rep_res),
self.millis,
)?;
debug!(" -- report set: {}", rep_res);
@@ -264,8 +264,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 db = DataBuf::from(&mut buf);
- match pipe.in_transfer(&mut db, 15, self.millis) {
+ match pipe.in_transfer(&mut buf, 15, self.millis) {
Ok(bytes_received) => {
let tmp = unsafe { &(buf.assume_init())[..bytes_received] };
info!("report {}: {:?}", id, tmp);