revert test
This commit is contained in:
doryan 2025-06-29 21:00:11 +03:00
parent 76193cee11
commit 51ea3e94f9

View File

@ -57,11 +57,6 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
let target_endpoint = &mut self.ep_table[address.index()];
// Set endpoint parameters. //
target_endpoint.set_dir(ep_dir);
target_endpoint.set_type(ep_type);
// Get power of two number of endpoint size. //
let ep_size = max(8, max_packet_size.next_power_of_two());
@ -71,10 +66,14 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
if DPRAM_SIZE - self.dpram_already_used < ep_size {
Err(UsbError::EndpointMemoryOverflow)
} else {
// Add used dpram memory. //
// Set endpoint parameters. //
target_endpoint.set_dir(ep_dir);
target_endpoint.set_type(ep_type);
target_endpoint.set_size(ep_size)?;
// Add used dpram memory. //
target_endpoint.is_allocated = true;
self.dpram_already_used += ep_size;