Fixed a problem with OTG USB on STM32H723/33/25/35.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15569 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2022-03-31 12:41:02 +00:00
parent 6d88ef4c72
commit 6879635b5e
2 changed files with 17 additions and 16 deletions

View File

@ -178,19 +178,6 @@
#error "STM32_OTGx_NUMBER not defined in registry"
#endif
/**
* @brief Maximum endpoint address.
*/
#if (STM32_HAS_OTG2 && STM32_USB_USE_OTG2) || defined(__DOXYGEN__)
#if (STM32_OTG1_ENDPOINTS < STM32_OTG2_ENDPOINTS) || defined(__DOXYGEN__)
#define USB_MAX_ENDPOINTS STM32_OTG2_ENDPOINTS
#else
#define USB_MAX_ENDPOINTS STM32_OTG1_ENDPOINTS
#endif
#else
#define USB_MAX_ENDPOINTS STM32_OTG1_ENDPOINTS
#endif
#if STM32_USB_USE_OTG1 && !STM32_HAS_OTG1
#error "OTG1 not present in the selected device"
#endif
@ -203,6 +190,19 @@
#error "USB driver activated but no USB peripheral assigned"
#endif
/* Maximum endpoint address.*/
#if STM32_HAS_OTG1 && STM32_USB_USE_OTG1 && STM32_HAS_OTG2 && STM32_USB_USE_OTG2
#if STM32_OTG1_ENDPOINTS < STM32_OTG2_ENDPOINTS
#define USB_MAX_ENDPOINTS STM32_OTG2_ENDPOINTS
#else
#define USB_MAX_ENDPOINTS STM32_OTG1_ENDPOINTS
#endif
#elif STM32_HAS_OTG1 && STM32_USB_USE_OTG1
#define USB_MAX_ENDPOINTS STM32_OTG1_ENDPOINTS
#elif STM32_HAS_OTG2 && STM32_USB_USE_OTG2
#define USB_MAX_ENDPOINTS STM32_OTG2_ENDPOINTS
#endif
#if STM32_USB_USE_OTG1 && \
!OSAL_IRQ_IS_VALID_PRIORITY(STM32_USB_OTG1_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to OTG1"

View File

@ -539,10 +539,11 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 2
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 8
#define STM32_HAS_OTG1 FALSE
#define STM32_HAS_OTG2 TRUE
#define STM32_OTG2_ENDPOINTS 8
#define STM32_HAS_OTG2 FALSE
#define STM32_HAS_USB FALSE
/* IWDG attributes.*/