Skip to content

Commit 78c163b

Browse files
committed
Update usbd-serial and nrf-usbd to match, and fix build.
1 parent 45fa021 commit 78c163b

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

examples/usb/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ edition = "2018"
66
publish = false
77

88
[dependencies]
9-
cortex-m-rt = "0.7.0"
9+
cortex-m-rt = "0.7.3"
1010
panic-semihosting = "0.6.0"
1111
usb-device = "0.3.2"
12-
usbd-serial = "0.1.0"
12+
usbd-serial = "0.2.1"
1313

1414
[dependencies.nrf52840-hal]
1515
path = "../../nrf52840-hal"

examples/usb/src/bin/serial.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use cortex_m_rt::entry;
77
use nrf52840_hal::clocks::Clocks;
88
use nrf52840_hal::usbd::{UsbPeripheral, Usbd};
99
use usb_device::class_prelude::UsbBusAllocator;
10-
use usb_device::device::{UsbDeviceBuilder, UsbVidPid};
10+
use usb_device::device::{StringDescriptors, UsbDeviceBuilder, UsbVidPid};
1111
use usbd_serial::{SerialPort, USB_CLASS_CDC};
1212

1313
#[entry]
@@ -20,11 +20,14 @@ fn main() -> ! {
2020
let mut serial = SerialPort::new(&usb_bus);
2121

2222
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
23-
.manufacturer("Fake company")
24-
.product("Serial port")
25-
.serial_number("TEST")
23+
.strings(&[StringDescriptors::default()
24+
.manufacturer("Fake company")
25+
.product("Serial port")
26+
.serial_number("TEST")])
27+
.unwrap()
2628
.device_class(USB_CLASS_CDC)
2729
.max_packet_size_0(64) // (makes control transfers 8x faster)
30+
.unwrap()
2831
.build();
2932

3033
loop {

nrf-hal-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ optional = true
7373
version = "0.12.2"
7474

7575
[dependencies.nrf-usbd]
76-
version = "0.2.0"
76+
version = "0.3.0"
7777
optional = true
7878

7979
[dependencies.embedded-hal-02]

0 commit comments

Comments
 (0)