From 6b44fbee44962ae4d51b85983419da87b42294fc Mon Sep 17 00:00:00 2001 From: Adam Simpkins Date: Tue, 9 Apr 2024 11:04:29 -0700 Subject: [PATCH] Revert "new maybe_push_input() method" (#64) This reverts commit c1210a947d5474d138f5eff89210cedef1bc870e. (#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: https://github.com/rust-embedded-community/usb-device/pull/78 --- src/hid_class.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/hid_class.rs b/src/hid_class.rs index 5f57ad0..5c3e9d9 100644 --- a/src/hid_class.rs +++ b/src/hid_class.rs @@ -408,24 +408,6 @@ impl HIDClass<'_, B> { } } - pub fn maybe_push_input<'a, IR: AsInputReport>( - &self, - mut producer: impl FnMut() -> IR, - ) -> Option> { - 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