fix: remove redundant length check
This commit is contained in:
parent
21fcb661f1
commit
ae466a8aad
|
@ -84,17 +84,13 @@ pub(crate) const ONE_MS_16_MGHZ: u32 = 16000;
|
||||||
impl<const L: usize> UsbDevice<L> {
|
impl<const L: usize> UsbDevice<L> {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(pll: PLL, usb: USB_DEVICE) -> UsbBusAllocator<Self> {
|
pub fn new(pll: PLL, usb: USB_DEVICE) -> UsbBusAllocator<Self> {
|
||||||
if L > 1 {
|
UsbBusAllocator::new(Self {
|
||||||
UsbBusAllocator::new(Self {
|
pll: Mutex::new(pll),
|
||||||
pll: Mutex::new(pll),
|
usb: Mutex::new(usb),
|
||||||
usb: Mutex::new(usb),
|
ep_table: [USBEndpoint::default(); L],
|
||||||
ep_table: [USBEndpoint::default(); L],
|
pending_ins: Mutex::new(Cell::new(0u8)),
|
||||||
pending_ins: Mutex::new(Cell::new(0u8)),
|
dpram_already_used: 0,
|
||||||
dpram_already_used: 0,
|
})
|
||||||
})
|
|
||||||
} else {
|
|
||||||
panic!("Endpoint table cannot be with length <= 1")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
|
Loading…
Reference in New Issue