Skip to content

Commit

Permalink
Revert "new maybe_push_input() method"
Browse files Browse the repository at this point in the history
This reverts commit c1210a9. (twitchyliquid64#34)
This commit breaks the build since it attempts to use `EndpointIn`
methods from a PR that were never landed in the usb-device crate:
rust-embedded-community/usb-device#78
  • Loading branch information
simpkins committed Apr 9, 2024
1 parent c1210a9 commit 0a5e2c4
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/hid_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,24 +408,6 @@ impl<B: UsbBus> HIDClass<'_, B> {
}
}

pub fn maybe_push_input<'a, IR: AsInputReport>(
&self,
mut producer: impl FnMut() -> IR,
) -> Option<Result<usize>> {
if let Some(ep) = &self.in_ep {
let mut buff: [u8; 64] = [0; 64];
ep.maybe_write(|| {
let size = match serialize(&mut buff, &producer()) {
Ok(l) => l,
Err(_) => return Err(UsbError::BufferOverflow),
};
Ok(&buff[0..size])
})
} else {
Some(Err(UsbError::InvalidEndpoint))
}
}

/// Tries to write an input (device-to-host) report from the given raw bytes.
/// Data is expected to be a valid HID report for INPUT items. If report ID's
/// were used in the descriptor, the report ID corresponding to this report
Expand Down

0 comments on commit 0a5e2c4

Please sign in to comment.