aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-usb-driver/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-usb-driver/src/lib.rs b/embassy-usb-driver/src/lib.rs
index 789d6de93..3ad96c61d 100644
--- a/embassy-usb-driver/src/lib.rs
+++ b/embassy-usb-driver/src/lib.rs
@@ -242,7 +242,7 @@ pub trait EndpointOut: Endpoint {
242 /// 242 ///
243 /// This should also clear any NAK flags and prepare the endpoint to receive the next packet or 243 /// This should also clear any NAK flags and prepare the endpoint to receive the next packet or
244 /// data block. 244 /// data block.
245 async fn read_data(&mut self, buf: &mut [u8]) -> Result<usize, EndpointError> { 245 async fn read_transfer(&mut self, buf: &mut [u8]) -> Result<usize, EndpointError> {
246 let mut n = 0; 246 let mut n = 0;
247 loop { 247 loop {
248 let i = self.read(&mut buf[n..]).await?; 248 let i = self.read(&mut buf[n..]).await?;
@@ -370,11 +370,11 @@ pub trait EndpointIn: Endpoint {
370 /// 370 ///
371 /// If the buffer size is evenly divisible by wMaxPacketSize, this will also ensure the 371 /// If the buffer size is evenly divisible by wMaxPacketSize, this will also ensure the
372 /// terminating zero-length-packet is transmitted. 372 /// terminating zero-length-packet is transmitted.
373 async fn write_data(&mut self, buf: &[u8]) -> Result<(), EndpointError> { 373 async fn write_transfer(&mut self, buf: &[u8], needs_zlp: bool) -> Result<(), EndpointError> {
374 for chunk in buf.chunks(self.info().max_packet_size as usize) { 374 for chunk in buf.chunks(self.info().max_packet_size as usize) {
375 self.write(chunk).await?; 375 self.write(chunk).await?;
376 } 376 }
377 if buf.len() % self.info().max_packet_size as usize == 0 { 377 if needs_zlp && buf.len() % self.info().max_packet_size as usize == 0 {
378 self.write(&[]).await?; 378 self.write(&[]).await?;
379 } 379 }
380 Ok(()) 380 Ok(())