aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <[email protected]>2025-02-17 13:38:31 +0800
committerMatt Johnston <[email protected]>2025-02-17 13:38:31 +0800
commit5d6877cbc6c8f5570cce7b311cc06e2667897afb (patch)
treee0c266fb361fd7dc4e011498faee6864025243c8
parent897d42e01214396b448e5aae06a4186a4c282e7a (diff)
otg: Allow exact out buffer size
The existing check required N+1 buffer size.
-rw-r--r--embassy-usb-synopsys-otg/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs
index 44b2bd093..fc4428b54 100644
--- a/embassy-usb-synopsys-otg/src/lib.rs
+++ b/embassy-usb-synopsys-otg/src/lib.rs
@@ -357,7 +357,7 @@ impl<'d, const MAX_EP_COUNT: usize> Driver<'d, MAX_EP_COUNT> {
357 ); 357 );
358 358
359 if D::dir() == Direction::Out { 359 if D::dir() == Direction::Out {
360 if self.ep_out_buffer_offset + max_packet_size as usize >= self.ep_out_buffer.len() { 360 if self.ep_out_buffer_offset + max_packet_size as usize > self.ep_out_buffer.len() {
361 error!("Not enough endpoint out buffer capacity"); 361 error!("Not enough endpoint out buffer capacity");
362 return Err(EndpointAllocError); 362 return Err(EndpointAllocError);
363 } 363 }