remove free-interrupt context for endpoint allocator

This commit is contained in:
doryan 2025-05-05 23:09:42 +04:00
parent 4a90b9a6c8
commit f7c4b48b85

View File

@ -24,7 +24,6 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
_interval: u8, _interval: u8,
) -> UsbResult<EndpointAddress> { ) -> UsbResult<EndpointAddress> {
// Handle first endpoint. // // Handle first endpoint. //
free(|_cs| {
if ep_addr == Some(EndpointAddress::from_parts(0, UsbDirection::In)) { if ep_addr == Some(EndpointAddress::from_parts(0, UsbDirection::In)) {
Ok(ep_addr.unwrap()) Ok(ep_addr.unwrap())
} else { } else {
@ -40,8 +39,7 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
.enumerate() .enumerate()
.skip(1) .skip(1)
.find(|(index, ep)| { .find(|(index, ep)| {
!ep.is_allocated !ep.is_allocated && max_packet_size <= ENDPOINTS_ALLOC_LAYOUT[*index]
&& max_packet_size <= ENDPOINTS_ALLOC_LAYOUT[*index]
}) })
.ok_or(UsbError::EndpointOverflow)? .ok_or(UsbError::EndpointOverflow)?
.0; .0;
@ -77,7 +75,6 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
Ok(address) Ok(address)
} }
} }
})
} }
fn enable(&mut self) { fn enable(&mut self) {