From ba33139c0c71622d872dc04f4c37047ba059b673 Mon Sep 17 00:00:00 2001 From: Fabien Poussin Date: Sat, 13 Feb 2021 20:40:13 +0100 Subject: [PATCH] USBH: add defaults, fix some defines --- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 40 ++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index ffafe2cc..1eeecb46 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -25,14 +25,23 @@ #if !defined(STM32_OTG_FS_CHANNELS_NUMBER) #error "STM32_OTG_FS_CHANNELS_NUMBER must be defined" #endif +#if !defined(STM32_OTG1_USE_HS) +#define STM32_OTG1_USE_HS FALSE +#endif +#if !defined(STM32_OTG1_USE_ULPI) +#define STM32_OTG1_USE_ULPI FALSE +#endif +#if !defined(STM32_OTG1_USE_ULPI_VBUS) +#define STM32_OTG1_USE_ULPI_VBUS FALSE +#endif #if !defined(STM32_OTG_FS_RXFIFO_SIZE) -#define STM32_OTG_FS_RXFIFO_SIZE 1024 +#define STM32_OTG_FS_RXFIFO_SIZE 1024 #endif #if !defined(STM32_OTG_FS_PTXFIFO_SIZE) -#define STM32_OTG_FS_PTXFIFO_SIZE 128 +#define STM32_OTG_FS_PTXFIFO_SIZE 128 #endif #if !defined(STM32_OTG_FS_NPTXFIFO_SIZE) -#define STM32_OTG_FS_NPTXFIFO_SIZE 128 +#define STM32_OTG_FS_NPTXFIFO_SIZE 128 #endif #if !defined(STM32_OTG_FS_FIFO_MEM_SIZE) #define STM32_OTG_FS_FIFO_MEM_SIZE 320 @@ -47,12 +56,12 @@ #define OTG1 OTG_HS #define OTG1_CHANNELS_NUMBER STM32_OTG_HS_CHANNELS_NUMBER #else -#define rccEnableOTG1(lp) rccEnableUSB1_OTG_FS(lp) -#define rccDisableOTG1() rccDisableUSB1_OTG_FS() -#define rccResetOTG1() rccResetUSB1_OTG_FS() +#define rccEnableOTG1(lp) rccEnableOTG_FS(lp) +#define rccDisableOTG1() rccDisableOTG_FS() +#define rccResetOTG1() rccResetOTG_FS() #define OTG1 OTG_FS #define OTG1_CHANNELS_NUMBER STM32_OTG_FS_CHANNELS_NUMBER -#ifdef STM32_OTG1_USE_ULPI +#if STM32_OTG1_USE_ULPI #error "OTG1 has no ULPI on this platform" #endif #endif @@ -70,6 +79,15 @@ #if !defined(STM32_OTG_HS_CHANNELS_NUMBER) #error "STM32_OTG_HS_CHANNELS_NUMBER must be defined" #endif +#if !defined(STM32_OTG2_USE_HS) +#define STM32_OTG2_USE_HS FALSE +#endif +#if !defined(STM32_OTG2_USE_ULPI) +#define STM32_OTG2_USE_ULPI FALSE +#endif +#if !defined(STM32_OTG2_USE_ULPI_VBUS) +#define STM32_OTG2_USE_ULPI_VBUS FALSE +#endif #if !defined(STM32_OTG_HS_RXFIFO_SIZE) #define STM32_OTG_HS_RXFIFO_SIZE 2048 #endif @@ -91,13 +109,13 @@ #define rccResetOTG2() rccResetUSB2_OTG_FS() #define OTG2 OTG_FS #define OTG2_CHANNELS_NUMBER STM32_OTG_FS_CHANNELS_NUMBER -#ifdef STM32_OTG2_USE_ULPI +#if STM32_OTG2_USE_ULPI #error "OTG2 has no ULPI on this platform" #endif #else -#define rccEnableOTG2(lp) rccEnableUSB2_OTG_HS(lp) -#define rccDisableOTG2() rccDisableUSB2_OTG_HS() -#define rccResetOTG2() rccResetUSB2_OTG_HS() +#define rccEnableOTG2(lp) rccEnableOTG_HS(lp) +#define rccDisableOTG2() rccDisableOTG_HS() +#define rccResetOTG2() rccResetOTG_HS() #define rccEnableOTG2_HSULPI(x) rccEnableUSB2_HSULPI(x) #define rccDisableOTG2_HSULPI() rccDisableUSB2_HSULPI() #define rccResetOTG2_HSULPI() rccResetUSB2_HSULPI()