usb: add -usb-serial crate, fix warnings and stable build.

This commit is contained in:
Dario Nieuwenhuis
2022-03-30 01:18:37 +02:00
parent c06488eb29
commit d1e4b3d7d5
15 changed files with 265 additions and 27 deletions

View File

@ -136,6 +136,7 @@ impl<'a> DescriptorWriter<'a> {
)
}
#[allow(unused)]
pub(crate) fn end_class(&mut self) {
self.num_endpoints_mark = None;
}

View File

@ -302,7 +302,6 @@ impl<'d, D: Driver<'d>> UsbDevice<'d, D> {
async fn handle_get_descriptor(&mut self, req: Request) {
let (dtype, index) = req.descriptor_type_index();
let config = self.config.clone();
match dtype {
descriptor_type::BOS => self.control.accept_in(self.bos_descriptor).await,
@ -321,13 +320,10 @@ impl<'d, D: Driver<'d>> UsbDevice<'d, D> {
2 => self.config.product,
3 => self.config.serial_number,
_ => {
let index = StringIndex::new(index);
let lang_id = req.index;
let _index = StringIndex::new(index);
let _lang_id = req.index;
// TODO
None
//classes
// .iter()
// .filter_map(|cls| cls.get_string(index, lang_id))
// .nth(0)
}
};