From 2ddc96ff6641f2a0c2a9b0fe3dbb7369ce38f602 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 24 Mar 2023 14:52:37 +0100 Subject: [PATCH] arch/stm32/stm32.h: do not include stm32_usbdev.h if not supported --- arch/arm/src/stm32/stm32.h | 4 +++- arch/arm/src/stm32/stm32_otgfs.h | 3 +-- arch/arm/src/stm32/stm32_otgfsdev.c | 1 + arch/arm/src/stm32/stm32_otghs.h | 2 +- arch/arm/src/stm32/stm32_otghsdev.c | 1 + boards/arm/stm32/clicker2-stm32/src/stm32_usb.c | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32/stm32.h b/arch/arm/src/stm32/stm32.h index 313422a717..6c2ef6ce97 100644 --- a/arch/arm/src/stm32/stm32.h +++ b/arch/arm/src/stm32/stm32.h @@ -57,7 +57,9 @@ #include "stm32_i2s.h" #include "stm32_tim.h" #include "stm32_uart.h" -#include "stm32_usbdev.h" +#if defined(CONFIG_USBDEV) && defined(CONFIG_STM32_USB) +# include "stm32_usbdev.h" +#endif #include "stm32_wdg.h" #include "stm32_lowputc.h" #include "stm32_eth.h" diff --git a/arch/arm/src/stm32/stm32_otgfs.h b/arch/arm/src/stm32/stm32_otgfs.h index 51aa5f667b..b7305caeb9 100644 --- a/arch/arm/src/stm32/stm32_otgfs.h +++ b/arch/arm/src/stm32/stm32_otgfs.h @@ -26,11 +26,10 @@ ****************************************************************************/ #include +#include #include -#include "stm32.h" - #include "hardware/stm32fxxxxx_otgfs.h" #if defined(CONFIG_STM32_OTGFS) diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index f982d8a93c..a0a9ecb70e 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -47,6 +47,7 @@ #include "chip.h" #include "arm_internal.h" #include "stm32_otgfs.h" +#include "stm32_rcc.h" #if defined(CONFIG_USBDEV) && (defined(CONFIG_STM32_OTGFS)) /**************************************************************************** diff --git a/arch/arm/src/stm32/stm32_otghs.h b/arch/arm/src/stm32/stm32_otghs.h index a942a0c245..3d36a6408c 100644 --- a/arch/arm/src/stm32/stm32_otghs.h +++ b/arch/arm/src/stm32/stm32_otghs.h @@ -26,10 +26,10 @@ ****************************************************************************/ #include +#include #include -#include "stm32.h" #include "hardware/stm32_otghs.h" #if defined(CONFIG_STM32_OTGHS) diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index 72e9fff030..f16622ae53 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -47,6 +47,7 @@ #include "chip.h" #include "arm_internal.h" #include "stm32_otghs.h" +#include "stm32_rcc.h" #if defined(CONFIG_USBDEV) && (defined(CONFIG_STM32_OTGHS)) diff --git a/boards/arm/stm32/clicker2-stm32/src/stm32_usb.c b/boards/arm/stm32/clicker2-stm32/src/stm32_usb.c index 32197fdc32..9ef2a5a7a7 100644 --- a/boards/arm/stm32/clicker2-stm32/src/stm32_usb.c +++ b/boards/arm/stm32/clicker2-stm32/src/stm32_usb.c @@ -30,6 +30,7 @@ #include #include "stm32_otgfs.h" +#include "stm32_gpio.h" #include "clicker2-stm32.h" #ifdef CONFIG_STM32_OTGFS