fix(faderboard): instantiate serial port before usb bus allocator is frozen

This commit is contained in:
Luca 2024-07-16 03:52:27 +02:00
parent 4ce5d0a1b3
commit 15ee464440
1 changed files with 2 additions and 2 deletions

View File

@ -19,14 +19,14 @@ pub struct Usb<'a> {
impl<'a> Usb<'a> { impl<'a> Usb<'a> {
pub fn new(usb_bus: &'a UsbBusAllocator<UsbBusType>) -> Self { pub fn new(usb_bus: &'a UsbBusAllocator<UsbBusType>) -> Self {
let serial = SerialPort::new(usb_bus);
let usb_dev = UsbDeviceBuilder::new(usb_bus, UsbVidPid(VENDOR_ID, PRODUCT_ID)) let usb_dev = UsbDeviceBuilder::new(usb_bus, UsbVidPid(VENDOR_ID, PRODUCT_ID))
.manufacturer("lujoga") .manufacturer("lujoga")
.product("faderboard") .product("faderboard")
.max_power(500) .max_power(500)
.build(); .build();
let serial = SerialPort::new(&usb_bus);
Usb { usb_dev, serial } Usb { usb_dev, serial }
} }