aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-03-30 01:18:37 +0200
committerDario Nieuwenhuis <[email protected]>2022-04-06 05:38:11 +0200
commitd1e4b3d7d5a931cd6e04b7e2fe467945ef862477 (patch)
treeefe3199292133306c20b27da7442cadf8592f3b4 /embassy-usb
parentc06488eb2978d9eaa8dc6a2669a6ce279638f4b2 (diff)
usb: add -usb-serial crate, fix warnings and stable build.
Diffstat (limited to 'embassy-usb')
-rw-r--r--embassy-usb/Cargo.toml2
-rw-r--r--embassy-usb/src/descriptor.rs1
-rw-r--r--embassy-usb/src/lib.rs10
3 files changed, 4 insertions, 9 deletions
diff --git a/embassy-usb/Cargo.toml b/embassy-usb/Cargo.toml
index af5986c15..01bf5ef6f 100644
--- a/embassy-usb/Cargo.toml
+++ b/embassy-usb/Cargo.toml
@@ -8,6 +8,4 @@ embassy = { version = "0.1.0", path = "../embassy" }
8 8
9defmt = { version = "0.3", optional = true } 9defmt = { version = "0.3", optional = true }
10log = { version = "0.4.14", optional = true } 10log = { version = "0.4.14", optional = true }
11cortex-m = "0.7.3"
12num-traits = { version = "0.2.14", default-features = false }
13heapless = "0.7.10" \ No newline at end of file 11heapless = "0.7.10" \ No newline at end of file
diff --git a/embassy-usb/src/descriptor.rs b/embassy-usb/src/descriptor.rs
index 746c6b828..5f8b0d560 100644
--- a/embassy-usb/src/descriptor.rs
+++ b/embassy-usb/src/descriptor.rs
@@ -136,6 +136,7 @@ impl<'a> DescriptorWriter<'a> {
136 ) 136 )
137 } 137 }
138 138
139 #[allow(unused)]
139 pub(crate) fn end_class(&mut self) { 140 pub(crate) fn end_class(&mut self) {
140 self.num_endpoints_mark = None; 141 self.num_endpoints_mark = None;
141 } 142 }
diff --git a/embassy-usb/src/lib.rs b/embassy-usb/src/lib.rs
index cbb909244..5a6b21906 100644
--- a/embassy-usb/src/lib.rs
+++ b/embassy-usb/src/lib.rs
@@ -302,7 +302,6 @@ impl<'d, D: Driver<'d>> UsbDevice<'d, D> {
302 302
303 async fn handle_get_descriptor(&mut self, req: Request) { 303 async fn handle_get_descriptor(&mut self, req: Request) {
304 let (dtype, index) = req.descriptor_type_index(); 304 let (dtype, index) = req.descriptor_type_index();
305 let config = self.config.clone();
306 305
307 match dtype { 306 match dtype {
308 descriptor_type::BOS => self.control.accept_in(self.bos_descriptor).await, 307 descriptor_type::BOS => self.control.accept_in(self.bos_descriptor).await,
@@ -321,13 +320,10 @@ impl<'d, D: Driver<'d>> UsbDevice<'d, D> {
321 2 => self.config.product, 320 2 => self.config.product,
322 3 => self.config.serial_number, 321 3 => self.config.serial_number,
323 _ => { 322 _ => {
324 let index = StringIndex::new(index); 323 let _index = StringIndex::new(index);
325 let lang_id = req.index; 324 let _lang_id = req.index;
325 // TODO
326 None 326 None
327 //classes
328 // .iter()
329 // .filter_map(|cls| cls.get_string(index, lang_id))
330 // .nth(0)
331 } 327 }
332 }; 328 };
333 329