feat(code): format code
This commit is contained in:
parent
ddd6ee6ad2
commit
4ca8c4e8cf
|
@ -2,12 +2,12 @@ use core::cmp::max;
|
||||||
|
|
||||||
use avr_device::{
|
use avr_device::{
|
||||||
atmega32u4::{PLL, USB_DEVICE},
|
atmega32u4::{PLL, USB_DEVICE},
|
||||||
interrupt::{free, Mutex},
|
interrupt::{free, CriticalSection, Mutex},
|
||||||
};
|
};
|
||||||
use usb_device::{
|
use usb_device::{
|
||||||
bus::UsbBus,
|
bus::{PollResult, UsbBus},
|
||||||
endpoint::{EndpointAddress, EndpointType},
|
endpoint::{EndpointAddress, EndpointType},
|
||||||
Result, UsbDirection, UsbError,
|
Result as UsbResult, UsbDirection, UsbError,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
|
@ -20,7 +20,7 @@ pub(crate) struct USBEndpoint {
|
||||||
banks: u8,
|
banks: u8,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ENDPOINTS_ALLOC_LAYOUT : [u16; 7] = [64, 256, 64, 64, 64, 64, 64];
|
const ENDPOINTS_ALLOC_LAYOUT: [u16; 7] = [64, 256, 64, 64, 64, 64, 64];
|
||||||
|
|
||||||
impl USBEndpoint {
|
impl USBEndpoint {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -80,6 +80,7 @@ impl<const L: usize> UsbDevice<L> {
|
||||||
dpram_already_used: 0,
|
dpram_already_used: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn select_endpoint(
|
pub fn select_endpoint(
|
||||||
&mut self,
|
&mut self,
|
||||||
cs: CriticalSection<'_>,
|
cs: CriticalSection<'_>,
|
||||||
|
@ -100,6 +101,7 @@ impl<const L: usize> UsbDevice<L> {
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn configure_endpoint(
|
pub fn configure_endpoint(
|
||||||
&mut self,
|
&mut self,
|
||||||
cs: CriticalSection<'_>,
|
cs: CriticalSection<'_>,
|
||||||
|
@ -263,19 +265,15 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_stalled(&self, ep_addr: usb_device::endpoint::EndpointAddress) -> bool {
|
fn is_stalled(&self, ep_addr: EndpointAddress) -> bool {
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn poll(&self) -> usb_device::bus::PollResult {
|
fn poll(&self) -> PollResult {
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read(
|
fn read(&self, ep_addr: EndpointAddress, buf: &mut [u8]) -> usb_device::Result<usize> {
|
||||||
&self,
|
|
||||||
ep_addr: usb_device::endpoint::EndpointAddress,
|
|
||||||
buf: &mut [u8],
|
|
||||||
) -> usb_device::Result<usize> {
|
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +323,7 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_stalled(&self, ep_addr: usb_device::endpoint::EndpointAddress, stalled: bool) {
|
fn set_stalled(&self, ep_addr: EndpointAddress, stalled: bool) {
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,11 +331,7 @@ impl<const L: usize> UsbBus for UsbDevice<L> {
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write(
|
fn write(&self, ep_addr: EndpointAddress, buf: &[u8]) -> UsbResult<usize> {
|
||||||
&self,
|
|
||||||
ep_addr: usb_device::endpoint::EndpointAddress,
|
|
||||||
buf: &[u8],
|
|
||||||
) -> usb_device::Result<usize> {
|
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue