diff --git a/src/types/usb_device.rs b/src/types/usb_device.rs index e80a7c4..fdccbf3 100644 --- a/src/types/usb_device.rs +++ b/src/types/usb_device.rs @@ -14,7 +14,7 @@ use usb_device::{ #[derive(Default, Copy, Clone)] pub(crate) struct USBEndpoint { is_allocated: bool, - size: u16, + size: u8, ep_type: u8, ep_dir: bool, banks: u8, @@ -46,7 +46,16 @@ impl USBEndpoint { #[inline] fn set_size(&mut self, size: u16) { - self.size = size; + self.size = match size { + 8 => 0b000, + 16 => 0b001, + 32 => 0b010, + 64 => 0b011, + 128 => 0b100, + 256 => 0b101, + 512 => 0b110, + _ => unreachable!(), + } } }