Skip to content

Commit

Permalink
FIX: dma must always start at rx_buf start
Browse files Browse the repository at this point in the history
  • Loading branch information
r2axz committed Dec 1, 2020
1 parent fa799c3 commit 4dad6b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usb_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ static void usb_cdc_port_start_rx(int port) {
usb_cdc_state_t *cdc_state = &usb_cdc_states[port];
circ_buf_t *rx_buf = &cdc_state->rx_buf;
dma_rx_ch->CCR &= ~(DMA_CCR_EN);
dma_rx_ch->CMAR = (uint32_t)&rx_buf->data[rx_buf->head];
dma_rx_ch->CMAR = (uint32_t)&rx_buf->data;
dma_rx_ch->CNDTR = USB_CDC_BUF_SIZE;
dma_rx_ch->CCR |= DMA_CCR_EN;
}
Expand Down

0 comments on commit 4dad6b6

Please sign in to comment.