Skip to content

Commit

Permalink
Adjust fifo reserved size.
Browse files Browse the repository at this point in the history
  • Loading branch information
HiFiPhile committed Apr 21, 2024
1 parent a64c394 commit 9cafcdd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/portable/synopsys/dwc2/dcd_dwc2.c
Expand Up @@ -375,9 +375,9 @@ static void bus_reset(uint8_t rhport) {
// Setup the control endpoint 0
_allocated_fifo_words_tx = 16;

// DMA needs extra space for processing
// DMA needs extra space for processing, needs size confirmation
if(dma_supported(rhport)) {
_allocated_fifo_words_tx += 2 * ep_count;
_allocated_fifo_words_tx += 72;
}

// Control IN uses FIFO 0 with 64 bytes ( 16 32-bit word )
Expand Down Expand Up @@ -777,6 +777,11 @@ void dcd_edpt_close_all(uint8_t rhport) {
// reset allocated fifo IN
_allocated_fifo_words_tx = 16;

// DMA needs extra space for processing, needs size confirmation
if(dma_supported(rhport)) {
_allocated_fifo_words_tx += 72;
}

fifo_flush_tx(dwc2, 0x10); // all tx fifo
fifo_flush_rx(dwc2);
}
Expand Down

0 comments on commit 9cafcdd

Please sign in to comment.