usb使用dma
This commit is contained in:
@@ -51,6 +51,8 @@ extern "C" {
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
#define CFG_TUD_DWC2_DMA_ENABLE 1
|
||||
|
||||
#define CFG_TUSB_MCU OPT_MCU_STM32F4
|
||||
// defined by compiler flags for flexibility
|
||||
#ifndef CFG_TUSB_MCU
|
||||
|
@@ -251,7 +251,7 @@ bool dwc2_core_init(uint8_t rhport, bool is_highspeed, bool is_dma) {
|
||||
|
||||
if (is_dma) {
|
||||
// DMA seems to be only settable after a core reset, and not possible to switch on-the-fly
|
||||
dwc2->gahbcfg |= GAHBCFG_DMAEN | GAHBCFG_HBSTLEN_2;
|
||||
dwc2->gahbcfg |= GAHBCFG_DMAEN | GAHBCFG_HBSTLEN_3;
|
||||
} else {
|
||||
dwc2->gintmsk |= GINTSTS_RXFLVL;
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ extern "C" {
|
||||
#define EP_MAX_FS 5
|
||||
#define EP_FIFO_SIZE_FS 0x1000
|
||||
|
||||
#define EP_MAX_HS 5
|
||||
#define EP_MAX_HS 6
|
||||
#define EP_FIFO_SIZE_HS 0x1000
|
||||
|
||||
// #define USB_OTG_HS_BASE_ADDR 0x40040000
|
||||
|
Reference in New Issue
Block a user