feat: remove pending_ins field and it usage
This commit is contained in:
parent
c510d908d3
commit
16e254d7dc
|
@ -190,7 +190,6 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
|||
|
||||
if usb.usbcon.read().frzclk().bit_is_clear() {
|
||||
let (mut ep_out, mut ep_in_complete, mut ep_setup) = (0u16, 0u16, 0u16);
|
||||
let pending_ins = self.pending_ins.borrow(cs);
|
||||
|
||||
for (ep_index, _ep) in self.allocated_endpoints() {
|
||||
if self.select_endpoint(cs, ep_index).is_err() {
|
||||
|
@ -205,9 +204,8 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
|||
ep_setup |= 1 << ep_index;
|
||||
}
|
||||
|
||||
if pending_ins.get() & (1 << ep_index) != 0 && ueintx.txini().bit_is_set() {
|
||||
if ueintx.txini().bit_is_set() {
|
||||
ep_in_complete |= 1 << ep_index;
|
||||
pending_ins.set(pending_ins.get() & !(1 << ep_index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -452,9 +450,6 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
|||
}
|
||||
};
|
||||
|
||||
let pending_ins = self.pending_ins.borrow(cs);
|
||||
pending_ins.set(pending_ins.get() | 1 << ep_addr.index());
|
||||
|
||||
Ok(buf.len())
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use core::cell::Cell;
|
||||
|
||||
use avr_device::{
|
||||
atmega32u4::{PLL, USB_DEVICE},
|
||||
interrupt::{CriticalSection, Mutex},
|
||||
|
@ -72,7 +70,6 @@ pub struct UsbDevice<const L: usize> {
|
|||
pub(crate) pll: Mutex<PLL>,
|
||||
pub(crate) usb: Mutex<USB_DEVICE>,
|
||||
pub(crate) ep_table: [USBEndpoint; L],
|
||||
pub(crate) pending_ins: Mutex<Cell<u8>>,
|
||||
pub(crate) dpram_already_used: u16,
|
||||
}
|
||||
|
||||
|
@ -88,7 +85,6 @@ impl<const L: usize> UsbDevice<L> {
|
|||
pll: Mutex::new(pll),
|
||||
usb: Mutex::new(usb),
|
||||
ep_table: [USBEndpoint::default(); L],
|
||||
pending_ins: Mutex::new(Cell::new(0u8)),
|
||||
dpram_already_used: 0,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue