mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
arch/arm/src/stm32 and boards/arm/stm32/olimex-stm32-p207/src: Fix an error found in build testing. There is not relationship be CONFIG_STM32_USBHOST and CONFIG_USBHOST, yet they they are used interchangably. This means that can (and did) get out of synch causing link time failures. This commit adds logic to select CONFIG_USBHOST when CONFIG_STM32_USBHOST is selected, keeping the two settings syncrhonized. Furthermore, since CONFIG_STM32_USBHOST is the authoritative setting, all ocurrences of CONFIG_USBHOST were replaced with CONFIG_STM32_USBHOST in the architecture code and in this one board code that was producing the error in build testing.
This commit is contained in:
@@ -2514,13 +2514,13 @@ config STM32_OTGFS
|
||||
bool "OTG FS"
|
||||
default n
|
||||
depends on STM32_HAVE_OTGFS
|
||||
select USBHOST_HAVE_ASYNCH if USBHOST
|
||||
select USBHOST_HAVE_ASYNCH if STM32_USBHOST
|
||||
|
||||
config STM32_OTGHS
|
||||
bool "OTG HS"
|
||||
default n
|
||||
depends on STM32_STM32F20XX || STM32_STM32F4XXX
|
||||
select USBHOST_HAVE_ASYNCH if USBHOST
|
||||
select USBHOST_HAVE_ASYNCH if STM32_USBHOST
|
||||
|
||||
config STM32_PWR
|
||||
bool "PWR"
|
||||
@@ -9255,6 +9255,7 @@ config STM32_USBHOST
|
||||
bool "Enable USB Host Support"
|
||||
depends on STM32_OTGFS || STM32_OTGHS
|
||||
default n
|
||||
select USBHOST
|
||||
|
||||
menu "USB FS Host Configuration"
|
||||
depends on STM32_OTGFS && STM32_USBHOST
|
||||
|
||||
@@ -90,7 +90,7 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
struct usbhost_connection_s;
|
||||
FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller);
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#include "stm32_gpio.h"
|
||||
#include "stm32_usbhost.h"
|
||||
|
||||
#if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGFS)
|
||||
#if defined(CONFIG_STM32_USBHOST) && defined(CONFIG_STM32_OTGFS)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -82,9 +82,10 @@
|
||||
*
|
||||
* Pre-requisites
|
||||
*
|
||||
* CONFIG_USBHOST - Enable general USB host support
|
||||
* CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block
|
||||
* CONFIG_STM32_SYSCFG - Needed
|
||||
* CONFIG_STM32_USBHOST - Enable STM32 USB host support
|
||||
* CONFIG_USBHOST - Enable general USB host support
|
||||
* CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block
|
||||
* CONFIG_STM32_SYSCFG - Needed
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
@@ -5442,4 +5443,4 @@ FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller)
|
||||
return &g_usbconn;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USBHOST && CONFIG_STM32_OTGFS */
|
||||
#endif /* CONFIG_STM32_USBHOST && CONFIG_STM32_OTGFS */
|
||||
|
||||
@@ -89,7 +89,7 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
struct usbhost_connection_s;
|
||||
FAR struct usbhost_connection_s *stm32_otghshost_initialize(int controller);
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#include "stm32_gpio.h"
|
||||
#include "stm32_usbhost.h"
|
||||
|
||||
#if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGHS)
|
||||
#if defined(CONFIG_STM32_USBHOST) && defined(CONFIG_STM32_OTGHS)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -82,9 +82,10 @@
|
||||
*
|
||||
* Pre-requisites
|
||||
*
|
||||
* CONFIG_USBHOST - Enable general USB host support
|
||||
* CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block
|
||||
* CONFIG_STM32_SYSCFG - Needed
|
||||
* CONFIG_STM32_USBHOST - Enable STM32 USB host support
|
||||
* CONFIG_USBHOST - Enable general USB host support
|
||||
* CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block
|
||||
* CONFIG_STM32_SYSCFG - Needed
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
@@ -5447,4 +5448,4 @@ FAR struct usbhost_connection_s *stm32_otghshost_initialize(int controller)
|
||||
return &g_usbconn;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USBHOST && CONFIG_STM32_OTGHS */
|
||||
#endif /* CONFIG_STM32_USBHOST && CONFIG_STM32_OTGHS */
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "hardware/stm32fxxxxx_otgfs.h"
|
||||
#include "hardware/stm32_otghs.h"
|
||||
|
||||
#if (defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS)) && defined(CONFIG_USBHOST)
|
||||
#if (defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS)) && defined(CONFIG_STM32_USBHOST)
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
@@ -209,11 +209,12 @@ enum usbhost_trace1codes_e
|
||||
*
|
||||
* Pre-requisites
|
||||
*
|
||||
* CONFIG_USBHOST - Enable general USB host support
|
||||
* CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block
|
||||
* CONFIG_STM32_USBHOST - Enable general USB host support
|
||||
* CONFIG_USBHOST - Enable general USB host support
|
||||
* CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block
|
||||
* or
|
||||
* CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block
|
||||
* CONFIG_STM32_SYSCFG - Needed
|
||||
* CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block
|
||||
* CONFIG_STM32_SYSCFG - Needed
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
@@ -290,5 +291,5 @@ void stm32_usbhost_vbusdrive(int iface, bool enable);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* CONFIG_STM32_OTGFS && CONFIG_USBHOST */
|
||||
#endif /* CONFIG_STM32_OTGFS && CONFIG_STM32_USBHOST */
|
||||
#endif /* __ARCH_ARM_SRC_STM32_STM32_USBHOST_H */
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN9)
|
||||
#define GPIO_OTGFS_PWRON (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN2)
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTB|GPIO_PIN10)
|
||||
|
||||
#else
|
||||
@@ -120,7 +120,7 @@ void weak_function stm32_usbinitialize(void);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST)
|
||||
#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_STM32_USBHOST)
|
||||
int stm32_usbhost_initialize(void);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -84,7 +84,8 @@
|
||||
|
||||
/* Can't support USB host is USB host is not enabled */
|
||||
|
||||
#ifndef CONFIG_USBHOST
|
||||
#ifndef CONFIG_STM32_USBHOST
|
||||
# undef CONFIG_USBHOST
|
||||
# undef HAVE_USBHOST
|
||||
#endif
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
*
|
||||
* Description:
|
||||
* All STM32 architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* is called early in the initialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
*
|
||||
****************************************************************************/
|
||||
@@ -65,7 +65,7 @@ void stm32_boardinitialize(void)
|
||||
{
|
||||
/* Initialize USB if the 1) OTG FS controller is in the configuration and 2)
|
||||
* disabled, and 3) the weak function stm32_usbinitialize() has been brought
|
||||
* into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also
|
||||
* into the build. Presumably either CONFIG_USBDEV or CONFIG_USBHOST is also
|
||||
* selected.
|
||||
*/
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
static struct usbhost_connection_s *g_usbconn;
|
||||
#endif
|
||||
|
||||
@@ -101,7 +101,7 @@ static struct usbhost_connection_s *g_usbconn;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
static int usbhost_waiter(int argc, char *argv[])
|
||||
{
|
||||
struct usbhost_hubport_s *hport;
|
||||
@@ -166,7 +166,7 @@ void stm32_usbinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
int stm32_usbhost_initialize(void)
|
||||
{
|
||||
int pid;
|
||||
@@ -247,7 +247,7 @@ int stm32_usbhost_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
int stm32_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
{
|
||||
return stm32_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, arg);
|
||||
@@ -280,7 +280,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
#ifdef CONFIG_STM32_USBHOST
|
||||
void stm32_usbhost_vbusdrive(int iface, bool enable)
|
||||
{
|
||||
DEBUGASSERT(iface == 0);
|
||||
|
||||
Reference in New Issue
Block a user