Skip to content

Commit d0ff829

Browse files
authored
Merge pull request #5 from probe-rs/update-usb-device
Update usb device
2 parents e1b6b29 + 44d4204 commit d0ff829

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

Cargo.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22
name = "dap-rs"
33
version = "0.1.0"
44
edition = "2021"
5-
authors = ["Emil Fresk <[email protected]>", "Adam Greig <[email protected]>"]
5+
authors = [
6+
"Emil Fresk <[email protected]>",
7+
"Adam Greig <[email protected]>",
8+
]
69

710
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
811

912
[dependencies]
1013
num_enum = { version = "0.5.6", default-features = false }
11-
usb-device = { version = "0.2.8", features = ["control-buffer-256"] }
12-
embedded-hal = "0.2.7"
13-
replace_with = { version = "0.1.7", default-features = false, features = ["panic_abort"] }
14+
usb-device = { version = "0.3.1", features = ["control-buffer-256"] }
15+
embedded-hal = "1.0.0"
16+
replace_with = { version = "0.1.7", default-features = false, features = [
17+
"panic_abort",
18+
] }
1419
bitflags = "1.3.2"
1520

1621
[dependencies.defmt]

src/dap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{swj, jtag, swd, swo, usb};
1+
use crate::{jtag, swd, swj, swo, usb};
22

33
mod command;
44
mod request;
@@ -9,7 +9,7 @@ pub use command::*;
99
pub use request::*;
1010
pub use response::*;
1111

12-
pub use embedded_hal::blocking::delay::DelayUs;
12+
pub use embedded_hal::delay::DelayNs;
1313

1414
use state::State;
1515

@@ -36,7 +36,7 @@ impl<'a, DEPS, LEDS, WAIT, JTAG, SWD, SWO> Dap<'a, DEPS, LEDS, WAIT, JTAG, SWD,
3636
where
3737
DEPS: swj::Dependencies<SWD, JTAG>,
3838
LEDS: DapLeds,
39-
WAIT: DelayUs<u32>,
39+
WAIT: DelayNs,
4040
JTAG: jtag::Jtag<DEPS>,
4141
SWD: swd::Swd<DEPS>,
4242
SWO: swo::Swo,

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ pub mod swd;
1010
pub mod swj;
1111
pub mod swo;
1212
pub mod usb;
13+
14+
// Re-export the usb-device crate, so that crates depending on us can use it without
15+
// having to track it as a separate dependency.
16+
pub use usb_device;

src/usb/dap_v1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ impl<B: UsbBus> UsbClass<B> for CmsisDapV1<'_, B> {
104104
Ok(())
105105
}
106106

107-
fn get_string(&self, index: StringIndex, _lang_id: u16) -> Option<&str> {
107+
fn get_string(&self, index: StringIndex, _lang_id: LangID) -> Option<&str> {
108108
if index == self.name {
109-
Some("HS-Probe CMSIS-DAP v1 Interface")
109+
Some("CMSIS-DAP v1 Interface")
110110
} else {
111111
None
112112
}

src/usb/dap_v2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ impl<B: UsbBus> UsbClass<B> for CmsisDapV2<'_, B> {
6464
Ok(())
6565
}
6666

67-
fn get_string(&self, index: StringIndex, _lang_id: u16) -> Option<&str> {
67+
fn get_string(&self, index: StringIndex, _lang_id: LangID) -> Option<&str> {
6868
if index == self.name {
69-
Some("HS-probe CMSIS-DAP v2 Interface")
69+
Some("CMSIS-DAP v2 Interface")
7070
} else {
7171
None
7272
}

0 commit comments

Comments
 (0)