Skip to content

Commit

Permalink
Updating examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-summers committed Nov 20, 2023
1 parent 4d424ff commit 086d574
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
8 changes: 5 additions & 3 deletions examples/usb_passthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ fn main() -> ! {
let mut serial1 = usbd_serial::SerialPort::new(&usb1_bus);
let mut usb1_dev =
UsbDeviceBuilder::new(&usb1_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")
]).unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();

Expand Down
10 changes: 6 additions & 4 deletions examples/usb_phy_serial_interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ unsafe fn main() -> ! {
USB_BUS_ALLOCATOR.as_ref().unwrap(),
UsbVidPid(VID, PID),
)
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")
]).unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.max_packet_size_0(64)
.max_packet_size_0(64).unwrap()
.build();

interrupt_free(|cs| {
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_rtic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ mod app {
.unwrap();
let serial = usbd_serial::SerialPort::new(usb_bus);
let usb_dev = UsbDeviceBuilder::new(usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.strings(&[usb_device::device::StringDescriptors::default()
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST PORT 1")
]).unwrap()
.device_class(usbd_serial::USB_CLASS_CDC)
.build();
let usb = (usb_dev, serial);
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ fn main() -> ! {

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

Expand Down
6 changes: 3 additions & 3 deletions src/usb_hs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use crate::rcc;
use crate::stm32;

use crate::gpio::{self, Alternate, Analog, Speed};
use crate::gpio::{self, Alternate, Speed};

use crate::time::Hertz;

Expand Down Expand Up @@ -50,8 +50,8 @@ impl USB1 {
usb_global: stm32::OTG1_HS_GLOBAL,
usb_device: stm32::OTG1_HS_DEVICE,
usb_pwrclk: stm32::OTG1_HS_PWRCLK,
_pin_dm: gpio::PA11<Analog>,
_pin_dp: gpio::PA12<Analog>,
_pin_dm: gpio::PA11<crate::gpio::Analog>,
_pin_dp: gpio::PA12<crate::gpio::Analog>,
prec: rcc::rec::Usb1Otg,
clocks: &rcc::CoreClocks,
) -> Self {
Expand Down

0 comments on commit 086d574

Please sign in to comment.