diff options
| author | hathach <[email protected]> | 2019-09-12 11:49:30 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-12 11:49:30 +0700 |
| commit | d256f33bbaa28f75930e6e21f122a7031d59b666 (patch) | |
| tree | ae66546dcef6c1f2c9a6e1b96c49e780a3d425c6 /src | |
| parent | e5d0ee53c421cbd6633063e692c0d437498653f8 (diff) | |
| parent | 72046d957cc6068aba7a66be013f02dcefdace58 (diff) | |
Merge pull request #146 from hathach/develop
ported stm32f2
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/st/synopsys/dcd_synopsys.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/portable/st/synopsys/dcd_synopsys.c b/src/portable/st/synopsys/dcd_synopsys.c index 56660643d..71c691223 100644 --- a/src/portable/st/synopsys/dcd_synopsys.c +++ b/src/portable/st/synopsys/dcd_synopsys.c @@ -27,29 +27,33 @@ #include "tusb_option.h" -#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_STM32F4 || \ +#if TUSB_OPT_DEVICE_ENABLED && ( CFG_TUSB_MCU == OPT_MCU_STM32F2 || \ + CFG_TUSB_MCU == OPT_MCU_STM32F4 || \ CFG_TUSB_MCU == OPT_MCU_STM32H7 || \ CFG_TUSB_MCU == OPT_MCU_STM32F7) // TODO Support OTG_HS // EP_MAX : Max number of bi-directional endpoints including EP0 // EP_FIFO_SIZE : Size of dedicated USB SRAM -#if CFG_TUSB_MCU == OPT_MCU_STM32F4 +#if CFG_TUSB_MCU == OPT_MCU_STM32F2 + #include "stm32f2xx.h" + #define EP_MAX USB_OTG_FS_MAX_IN_ENDPOINTS + #define EP_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE +#elif CFG_TUSB_MCU == OPT_MCU_STM32F4 #include "stm32f4xx.h" - - #define EP_MAX USB_OTG_FS_MAX_IN_ENDPOINTS - #define EP_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE + #define EP_MAX USB_OTG_FS_MAX_IN_ENDPOINTS + #define EP_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE #elif CFG_TUSB_MCU == OPT_MCU_STM32H7 #include "stm32h7xx.h" - - #define EP_MAX 9 - #define EP_FIFO_SIZE 4096 + #define EP_MAX 9 + #define EP_FIFO_SIZE 4096 // TODO The official name of the USB FS peripheral on H7 is "USB2_OTG_FS". -#else +#elif CFG_TUSB_MCU == OPT_MCU_STM32F7 #include "stm32f7xx.h" - - #define EP_MAX 6 - #define EP_FIFO_SIZE 1280 + #define EP_MAX 6 + #define EP_FIFO_SIZE 1280 +#else + #error "Unsupported MCUs" #endif #include "device/dcd.h" |
