Skip to content

Commit 36c86d1

Browse files
committed
Fix Tx FIFO memory calculation
This used to allocate 9 * 16 words minimum, no matter how many tx endpoints where active. Now we only account for memory allocated to enabled Tx endpoints when determining how much has already been used.
1 parent 54f4742 commit 36c86d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/endpoint_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl<USB: UsbPeripheral> EndpointMemoryAllocator<USB> {
153153
}
154154

155155
let mut used = self.total_rx_buffer_size_words() as usize + 30;
156-
for sz in &self.tx_fifo_size_words {
156+
for sz in &self.tx_fifo_size_words[0..ep_number] {
157157
used += core::cmp::max(*sz as usize, 16);
158158
}
159159
used -= 16;

0 commit comments

Comments
 (0)