feat(check): add check for endpoint table length
This commit is contained in:
parent
137fcc78e5
commit
29e5edde8a
|
@ -84,6 +84,7 @@ pub(crate) const ONE_MS_16_MGHZ: u32 = 16000;
|
|||
impl<const L: usize> UsbDevice<L> {
|
||||
#[inline]
|
||||
pub fn new(pll: PLL, usb: USB_DEVICE) -> UsbBusAllocator<Self> {
|
||||
if L > 1 {
|
||||
UsbBusAllocator::new(Self {
|
||||
pll: Mutex::new(pll),
|
||||
usb: Mutex::new(usb),
|
||||
|
@ -91,6 +92,9 @@ impl<const L: usize> UsbDevice<L> {
|
|||
pending_ins: Mutex::new(Cell::new(0u8)),
|
||||
dpram_already_used: 0,
|
||||
})
|
||||
} else {
|
||||
panic!("Endpoint table cannot be with length <= 1")
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Reference in New Issue