Improved OTG number of endpoints handling.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9860 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-10-13 13:07:20 +00:00
parent 0f0af8222f
commit f6a1b7e01d
6 changed files with 31 additions and 3 deletions

View File

@ -159,6 +159,14 @@
#error "STM32_HAS_OTGx not defined in registry"
#endif
#if STM32_HAS_OTG1 && !defined(STM32_OTG1_ENDPOINTS)
#error "STM32_OTG1_ENDPOINTS not defined in registry"
#endif
#if STM32_HAS_OTG2 && !defined(STM32_OTG2_ENDPOINTS)
#error "STM32_OTG2_ENDPOINTS 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"
@ -172,10 +180,14 @@
/**
* @brief Maximum endpoint address.
*/
#if !STM32_USB_USE_OTG2 || defined(__DOXYGEN__)
#define USB_MAX_ENDPOINTS 3
#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 5
#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

View File

@ -1334,6 +1334,7 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 1
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 3
#define STM32_HAS_OTG2 FALSE
#define STM32_HAS_USB FALSE

View File

@ -415,7 +415,9 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 2
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 5
#define STM32_HAS_OTG2 TRUE
#define STM32_OTG2_ENDPOINTS 8
#define STM32_HAS_USB FALSE
@ -756,7 +758,9 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 2
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 6
#define STM32_HAS_OTG2 TRUE
#define STM32_OTG2_ENDPOINTS 8
#define STM32_HAS_USB FALSE
@ -1119,7 +1123,9 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 1
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 3
#define STM32_HAS_OTG2 TRUE
#define STM32_OTG2_ENDPOINTS 5
#define STM32_HAS_USB FALSE
@ -1460,7 +1466,9 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 1
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 3
#define STM32_HAS_OTG2 TRUE
#define STM32_OTG2_ENDPOINTS 5
#define STM32_HAS_USB FALSE
@ -1752,6 +1760,7 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 1
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 4
#define STM32_HAS_OTG2 FALSE
#define STM32_HAS_USB FALSE
@ -2307,6 +2316,7 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 1
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 4
#define STM32_HAS_OTG2 FALSE
#define STM32_HAS_USB FALSE

View File

@ -462,10 +462,12 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 2
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 5
#define STM32_OTG1_HANDLER Vector14C
#define STM32_OTG1_NUMBER 67
#define STM32_HAS_OTG2 TRUE
#define STM32_OTG2_ENDPOINTS 8
#define STM32_OTG2_HANDLER Vector174
#define STM32_OTG2_EP1OUT_HANDLER Vector168
#define STM32_OTG2_EP1IN_HANDLER Vector16C

View File

@ -399,6 +399,7 @@
/* USB attributes.*/
#define STM32_OTG_STEPPING 2
#define STM32_HAS_OTG1 TRUE
#define STM32_OTG1_ENDPOINTS 5
#define STM32_OTG1_HANDLER Vector14C
#define STM32_OTG1_NUMBER 67

View File

@ -86,6 +86,8 @@
*****************************************************************************
*** Next ***
- HAL: Implemented better handling for number of endpoints on STM32 OTGv1
driver, now it is a registry key.
- VAR: Updated CMSIS file for STM32F1xx to 4.1.0.
- EX: Added thermometer implementation for ST HTS221 device.
- EX: Added hygrometer implementation for ST HTS221 device.