Skip to content

Commit

Permalink
Use updated version 0.3 of usb-device crate (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiffie authored Dec 28, 2024
1 parent b2b289f commit 60de132
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 193 deletions.
100 changes: 77 additions & 23 deletions examples/usb_serial/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions examples/usb_serial/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ default = ["pic32mx2xxfxxxb"]
mips-mcu = { version = "0.3.0", features = ["critical-section-single-core"] }
mips-rt = "0.3.6"
mips-mcu-alloc = "0.6.2"
embedded-hal = "0.2.7"
pic32-hal = { version = "0.11.0", features = ["usb-device"] }
panic-halt = "0.2.0"
usb-device = "0.2.9"
usbd-serial = "0.1.1"
embedded-hal = "1.0.0"
pic32-hal = { version = "0.12.1", features = ["usb-device"] }
panic-halt = "1.0.0"
usb-device = { version = "0.3.2", features = ["control-buffer-256"] }
usbd-serial = "0.2.2"
pic32-config-sector = "0.3.0"

[profile.release]
opt-level = 2
opt-level = 3
lto = true
debug = true

[patch.crates-io]
pic32-hal = { git = "https://github.com/kiffie/pic32-rs.git", branch = "usb03"}
10 changes: 6 additions & 4 deletions examples/usb_serial/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#![no_main]
#![feature(alloc_error_handler)]

use embedded_hal::digital::v2::*;
use embedded_hal::digital::{OutputPin, StatefulOutputPin};
use mips_mcu_alloc::MipsMcuHeap;
use mips_rt::entry;
use panic_halt as _;
Expand Down Expand Up @@ -92,9 +92,11 @@ fn main() -> ! {
let mut serial = usbd_serial::SerialPort::new(&usb_bus);

let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[StringDescriptors::new(LangID::EN)
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")])
.unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();

Expand Down
2 changes: 1 addition & 1 deletion pic32-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ embedded_hal_0_2 = { package = "embedded-hal", version = "0.2.7", features = ["u
mips-mcu = "0.3.0"
mips-rt = "0.3.0"
critical-section = "1.0.0"
usb-device = { version = "0.2.9", optional = true }
usb-device = { version = "0.3.2", optional = true }
enumflags2 = "0.7.7"

[dependencies.pic32mx2xx]
Expand Down
Loading

0 comments on commit 60de132

Please sign in to comment.