diff options
| author | Matt Johnston <[email protected]> | 2025-02-17 13:38:31 +0800 |
|---|---|---|
| committer | Matt Johnston <[email protected]> | 2025-02-17 13:38:31 +0800 |
| commit | 5d6877cbc6c8f5570cce7b311cc06e2667897afb (patch) | |
| tree | e0c266fb361fd7dc4e011498faee6864025243c8 /embassy-usb-synopsys-otg/src | |
| parent | 897d42e01214396b448e5aae06a4186a4c282e7a (diff) | |
otg: Allow exact out buffer size
The existing check required N+1 buffer size.
Diffstat (limited to 'embassy-usb-synopsys-otg/src')
| -rw-r--r-- | embassy-usb-synopsys-otg/src/lib.rs | 2 |
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 | } |
