From 29b3bff24700f39a08fbfb955c867bc422f200d9 Mon Sep 17 00:00:00 2001 From: doryan Date: Mon, 28 Apr 2025 18:50:45 +0300 Subject: [PATCH] revert 995bfd01699e20a62c4f3d22dca9de74098b8c50 revert feat: separate constructor for UsbDevice and UsbBusAllocator --- src/types/usb_device.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/types/usb_device.rs b/src/types/usb_device.rs index 6e6a4c4..435db71 100644 --- a/src/types/usb_device.rs +++ b/src/types/usb_device.rs @@ -83,19 +83,14 @@ pub(crate) const ONE_MS_16_MGHZ: u32 = 16000; impl UsbDevice { #[inline] - pub fn new(pll: PLL, usb: USB_DEVICE) -> Self { - Self { + pub fn create_usb_allocator(pll: PLL, usb: USB_DEVICE) -> UsbBusAllocator { + UsbBusAllocator::new(Self { pll: Mutex::new(pll), usb: Mutex::new(usb), ep_table: [USBEndpoint::default(); L], pending_ins: Mutex::new(Cell::new(0u8)), dpram_already_used: 0, - } - } - - #[inline] - pub fn into_usb_allocator(self) -> UsbBusAllocator { - UsbBusAllocator::new(self) + }) } #[inline]