Skip to content

Commit

Permalink
[hid] Remove unused interface
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherjimmy committed Sep 12, 2021
1 parent 223f50b commit c58282b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
21 changes: 2 additions & 19 deletions fw/src/hid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use usb_device::descriptor::DescriptorWriter;
use usb_device::endpoint::{EndpointAddress, EndpointIn};
use usb_device::UsbError;

const SPECIFICATION_RELEASE: u16 = 0x111;
const INTERFACE_CLASS_HID: u8 = 0x03;
pub const SPECIFICATION_RELEASE: u16 = 0x111;
pub const INTERFACE_CLASS_HID: u8 = 0x03;

#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
Expand Down Expand Up @@ -133,16 +133,6 @@ impl<B: UsbBus, D: HidDevice> HidClass<'_, B, D> {
}
}

fn get_report(&mut self, xfer: ControlIn<B>) {
let req = xfer.request();
let [report_type, report_id] = req.value.to_be_bytes();
let report_type = ReportType::from(report_type);
match self.device.get_report(report_type, report_id) {
Ok(data) => xfer.accept_with(data).ok(),
Err(()) => xfer.reject().ok(),
};
}

fn set_report(&mut self, xfer: ControlOut<B>) {
let req = xfer.request();
let [report_type, report_id] = req.value.to_be_bytes();
Expand Down Expand Up @@ -229,13 +219,6 @@ impl<B: UsbBus, D: HidDevice> UsbClass<B> for HidClass<'_, B, D> {
}
}
}
(RequestType::Class, Recipient::Interface) => {
if let Some(request) = Request::new(req.request) {
if request == Request::GetReport && req.index == self.interface_index() {
self.get_report(xfer);
}
}
}
_ => {}
}
}
Expand Down
1 change: 1 addition & 0 deletions fw/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub fn new_device(
.manufacturer("Me")
.product("Dactyl Manuform: OTE")
.serial_number(env!("CARGO_PKG_VERSION"))
.device_class(hid::INTERFACE_CLASS_HID)
.build()
}

Expand Down

0 comments on commit c58282b

Please sign in to comment.