Skip to content

Commit 50082de

Browse files
committed
Update usb-device to v0.3
1 parent 5fc68ca commit 50082de

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ edition = "2021"
55

66
[dependencies]
77
avr-device = { version = "0.5", features = ["atmega32u4"] }
8-
usb-device = "0.2"
8+
usb-device = "0.3"
99

1010
[dev-dependencies]
11-
usbd-hid = "0.6"
11+
usbd-hid = "0.7"
1212

1313
[dev-dependencies.arduino-hal]
1414
git = "https://github.com/Rahix/avr-hal.git"

examples/arduino_keyboard.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ use atmega_usbd::{SuspendNotifier, UsbBus};
4040
use avr_device::{asm::sleep, interrupt};
4141
use usb_device::{
4242
class_prelude::UsbBusAllocator,
43+
descriptor::lang_id::LangID::EN,
4344
device::{UsbDevice, UsbDeviceBuilder, UsbVidPid},
45+
prelude::StringDescriptors,
4446
};
4547
use usbd_hid::{
4648
descriptor::{KeyboardReport, SerializedDescriptor},
@@ -78,9 +80,12 @@ fn main() -> ! {
7880
};
7981

8082
let hid_class = HIDClass::new(usb_bus, KeyboardReport::desc(), 1);
81-
let usb_device = UsbDeviceBuilder::new(usb_bus, UsbVidPid(0x1209, 0x0001))
83+
let strings = StringDescriptors::new(EN)
8284
.manufacturer("Foo")
83-
.product("Bar")
85+
.product("Bar");
86+
let usb_device = UsbDeviceBuilder::new(usb_bus, UsbVidPid(0x1209, 0x0001))
87+
.strings(&[strings])
88+
.unwrap()
8489
.build();
8590

8691
unsafe {

src/lib.rs

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl<S: SuspendNotifier> usb_device::bus::UsbBus for UsbBus<S> {
204204
let entry = &mut self.endpoints[ep_addr.index()];
205205
entry.eptype_bits = match ep_type {
206206
EndpointType::Control => EP_TYPE_CONTROL,
207-
EndpointType::Isochronous => EP_TYPE_ISOCHRONOUS,
207+
EndpointType::Isochronous { .. } => EP_TYPE_ISOCHRONOUS,
208208
EndpointType::Bulk => EP_TYPE_BULK,
209209
EndpointType::Interrupt => EP_TYPE_INTERRUPT,
210210
};

0 commit comments

Comments
 (0)