From eb9e20c1dcf32713d41d969c07d1e947ad3a40a4 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 31 Jan 2017 09:59:29 +0000 Subject: More fixes related to endpoints number. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10072 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c | 4 ++-- os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h | 8 ++++++++ os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h | 12 ------------ 3 files changed, 10 insertions(+), 14 deletions(-) (limited to 'os') diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c index 73f585f21..069de3753 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c +++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c @@ -115,7 +115,7 @@ static const USBEndpointConfig ep0config = { static const stm32_otg_params_t fsparams = { STM32_USB_OTG1_RX_FIFO_SIZE / 4, STM32_OTG1_FIFO_MEM_SIZE, - STM32_OTG1_ENDOPOINTS_NUMBER + STM32_OTG1_ENDPOINTS }; #endif @@ -123,7 +123,7 @@ static const stm32_otg_params_t fsparams = { static const stm32_otg_params_t hsparams = { STM32_USB_OTG2_RX_FIFO_SIZE / 4, STM32_OTG2_FIFO_MEM_SIZE, - STM32_OTG2_ENDOPOINTS_NUMBER + STM32_OTG2_ENDPOINTS }; #endif diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h index 38dde56b2..5f94a67ab 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h +++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.h @@ -167,6 +167,14 @@ #error "STM32_OTG2_ENDPOINTS not defined in registry" #endif +#if STM32_HAS_OTG1 && !defined(STM32_OTG1_FIFO_MEM_SIZE) +#error "STM32_OTG1_FIFO_MEM_SIZE not defined in registry" +#endif + +#if STM32_HAS_OTG2 && !defined(STM32_OTG2_FIFO_MEM_SIZE) +#error "STM32_OTG2_FIFO_MEM_SIZE not defined in registry" +#endif + #if (STM32_USB_USE_OTG1 && !defined(STM32_OTG1_HANDLER)) || \ (STM32_USB_USE_OTG2 && !defined(STM32_OTG2_HANDLER)) #error "STM32_OTGx_HANDLER not defined in registry" diff --git a/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h b/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h index 82c843083..00b67b32a 100644 --- a/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h +++ b/os/hal/ports/STM32/LLD/OTGv1/stm32_otg.h @@ -25,18 +25,6 @@ #ifndef STM32_OTG_H #define STM32_OTG_H -/** - * @brief Number of the implemented endpoints in OTG_FS. - * @details This value does not include the endpoint 0 that is always present. - */ -#define STM32_OTG1_ENDOPOINTS_NUMBER 3 - -/** - * @brief Number of the implemented endpoints in OTG_HS. - * @details This value does not include the endpoint 0 that is always present. - */ -#define STM32_OTG2_ENDOPOINTS_NUMBER 5 - /** * @brief OTG_FS FIFO memory size in words. */ -- cgit v1.2.3