diff --git a/arch/arm/src/stm32/stm32_otgfs.h b/arch/arm/src/stm32/stm32_otgfs.h index e5a5820947d..51aa5f667b8 100644 --- a/arch/arm/src/stm32/stm32_otgfs.h +++ b/arch/arm/src/stm32/stm32_otgfs.h @@ -35,6 +35,14 @@ #if defined(CONFIG_STM32_OTGFS) +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Number of endpoints */ + +#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */ + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 8b53d27755e..f982d8a93c6 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -271,10 +271,6 @@ /* Endpoints ****************************************************************/ -/* Number of endpoints */ - -#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */ - /* Odd physical endpoint numbers are IN; even are OUT */ #define STM32_EPPHYIN2LOG(epphy) ((uint8_t)(epphy)|USB_DIR_IN) diff --git a/arch/arm/src/stm32/stm32_otghs.h b/arch/arm/src/stm32/stm32_otghs.h index 95fd182aed5..a942a0c245b 100644 --- a/arch/arm/src/stm32/stm32_otghs.h +++ b/arch/arm/src/stm32/stm32_otghs.h @@ -34,6 +34,14 @@ #if defined(CONFIG_STM32_OTGHS) +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Number of endpoints */ + +#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */ + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index d99bd2f6430..72e9fff0305 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -227,10 +227,6 @@ /* Endpoints ****************************************************************/ -/* Number of endpoints */ - -#define STM32_NENDPOINTS (4) /* ep0-3 x 2 for IN and OUT */ - /* Odd physical endpoint numbers are IN; even are OUT */ #define STM32_EPPHYIN2LOG(epphy) ((uint8_t)(epphy)|USB_DIR_IN) diff --git a/arch/arm/src/stm32/stm32_usbdev.c b/arch/arm/src/stm32/stm32_usbdev.c index 41252a194c0..9a56acea35e 100644 --- a/arch/arm/src/stm32/stm32_usbdev.c +++ b/arch/arm/src/stm32/stm32_usbdev.c @@ -103,7 +103,6 @@ * endpoint register sets there are. */ -#define STM32_NENDPOINTS (8) #define EP0 (0) #define EP1 (1) #define EP2 (2) diff --git a/arch/arm/src/stm32/stm32_usbdev.h b/arch/arm/src/stm32/stm32_usbdev.h index f5adfcb9f1a..b3839f720d9 100644 --- a/arch/arm/src/stm32/stm32_usbdev.h +++ b/arch/arm/src/stm32/stm32_usbdev.h @@ -32,6 +32,14 @@ #include "chip.h" #include "hardware/stm32_usbdev.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Number of endpoints */ + +#define STM32_NENDPOINTS (8) + /**************************************************************************** * Public Functions Prototypes ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_usbfs.c b/arch/arm/src/stm32/stm32_usbfs.c index 8232afe7c9e..3d5b717e8fa 100644 --- a/arch/arm/src/stm32/stm32_usbfs.c +++ b/arch/arm/src/stm32/stm32_usbfs.c @@ -84,7 +84,6 @@ * endpoint register sets there are. */ -#define STM32_NENDPOINTS (8) #define EP0 (0) #define EP1 (1) #define EP2 (2) diff --git a/arch/arm/src/stm32/stm32_usbfs.h b/arch/arm/src/stm32/stm32_usbfs.h index cbb66172be4..b4b4af3fda4 100644 --- a/arch/arm/src/stm32/stm32_usbfs.h +++ b/arch/arm/src/stm32/stm32_usbfs.h @@ -32,6 +32,14 @@ #include "chip.h" #include "hardware/stm32_usbfs.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Number of endpoints */ + +#define STM32_NENDPOINTS (8) + /**************************************************************************** * Public Functions Prototypes ****************************************************************************/ diff --git a/arch/arm/src/stm32f0l0g0/stm32_usbdev.c b/arch/arm/src/stm32f0l0g0/stm32_usbdev.c index 57a45b9341d..7c5a86ddea8 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_usbdev.c +++ b/arch/arm/src/stm32f0l0g0/stm32_usbdev.c @@ -89,7 +89,6 @@ * endpoint register sets there are. */ -#define STM32_NENDPOINTS (8) #define EP0 (0) #define EP1 (1) #define EP2 (2) diff --git a/arch/arm/src/stm32l4/stm32l4_otgfs.h b/arch/arm/src/stm32l4/stm32l4_otgfs.h index 10697e99823..c98b832c0b4 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfs.h +++ b/arch/arm/src/stm32l4/stm32l4_otgfs.h @@ -41,6 +41,14 @@ # error "Unsupported STM32L4 chip" #endif +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Number of endpoints */ + +#define STM32L4_NENDPOINTS (6) /* ep0-5 x 2 for IN and OUT */ + /**************************************************************************** * Public Functions Prototypes ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c index 4e8983612b1..b5f5f5314cc 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c @@ -106,10 +106,6 @@ # define CONFIG_USBDEV_EP5_TXFIFO_SIZE 128 #endif -/* Number of endpoints */ - -#define STM32L4_NENDPOINTS (6) /* ep0-5 x 2 for IN and OUT */ - /* Adjust actual number of endpoints based upon size; * 0 means 'not available', and we expect that the first 0-length endpoint * implies that all others after are unused as well (irrespective of what