More MSC work

This commit is contained in:
chemicstry
2023-02-17 01:30:45 +02:00
parent ab7e26a777
commit 9be45c3be9
14 changed files with 831 additions and 86 deletions

View File

@ -1127,6 +1127,7 @@ impl<'d, T: Instance> embassy_usb_driver::EndpointOut for Endpoint<'d, T, Out> {
impl<'d, T: Instance> embassy_usb_driver::EndpointIn for Endpoint<'d, T, In> {
async fn write(&mut self, buf: &[u8]) -> Result<(), EndpointError> {
trace!("write ep={:?} data={:?}", self.info.addr, buf);
// info!("w:{}", self.info.addr.index());
if buf.len() > self.info.max_packet_size as usize {
return Err(EndpointError::BufferOverflow);
@ -1152,6 +1153,8 @@ impl<'d, T: Instance> embassy_usb_driver::EndpointIn for Endpoint<'d, T, In> {
})
.await?;
info!("ww");
if buf.len() > 0 {
poll_fn(|cx| {
state.ep_in_wakers[index].register(cx.waker());
@ -1206,6 +1209,7 @@ impl<'d, T: Instance> embassy_usb_driver::EndpointIn for Endpoint<'d, T, In> {
unsafe { r.fifo(index).write_value(regs::Fifo(u32::from_ne_bytes(tmp))) };
}
info!("wd");
trace!("write done ep={:?}", self.info.addr);
Ok(())