From 15ee464440947516aa31eba42878015abb65b0b2 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 16 Jul 2024 03:52:27 +0200 Subject: [PATCH] fix(faderboard): instantiate serial port before usb bus allocator is frozen --- firmware/faderboard/src/usb.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/faderboard/src/usb.rs b/firmware/faderboard/src/usb.rs index 2efece4..1ccc6fd 100644 --- a/firmware/faderboard/src/usb.rs +++ b/firmware/faderboard/src/usb.rs @@ -19,14 +19,14 @@ pub struct Usb<'a> { impl<'a> Usb<'a> { pub fn new(usb_bus: &'a UsbBusAllocator) -> Self { + let serial = SerialPort::new(usb_bus); + let usb_dev = UsbDeviceBuilder::new(usb_bus, UsbVidPid(VENDOR_ID, PRODUCT_ID)) .manufacturer("lujoga") .product("faderboard") .max_power(500) .build(); - let serial = SerialPort::new(&usb_bus); - Usb { usb_dev, serial } }