mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Fix some conditional logic that I broke with a preceding commit
This commit is contained in:
@@ -116,6 +116,12 @@
|
|||||||
# undef HAVE_USBMONITOR
|
# undef HAVE_USBMONITOR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static bool g_app_initialzed;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -130,13 +136,20 @@
|
|||||||
|
|
||||||
int board_app_initialize(void)
|
int board_app_initialize(void)
|
||||||
{
|
{
|
||||||
|
/* Check if already initialized */
|
||||||
|
|
||||||
|
if (g_app_initialzed)
|
||||||
|
{
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SST25
|
#ifdef HAVE_SST25
|
||||||
|
{
|
||||||
FAR struct spi_dev_s *spi;
|
FAR struct spi_dev_s *spi;
|
||||||
FAR struct mtd_dev_s *mtd;
|
FAR struct mtd_dev_s *mtd;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Configure SPI-based devices */
|
/* Configure SPI-based devices */
|
||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
@@ -181,6 +194,7 @@ int board_app_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SPARK_MOUNT_FLASH
|
#ifdef CONFIG_SPARK_MOUNT_FLASH
|
||||||
|
{
|
||||||
char partname[16];
|
char partname[16];
|
||||||
char mntpoint[16];
|
char mntpoint[16];
|
||||||
|
|
||||||
@@ -199,7 +213,7 @@ int board_app_initialize(void)
|
|||||||
fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno);
|
fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
@@ -265,10 +279,13 @@ int board_app_initialize(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_SPARK_FLASH_PART */
|
#endif /* CONFIG_SPARK_FLASH_PART */
|
||||||
|
}
|
||||||
#endif /* HAVE_SST25 */
|
#endif /* HAVE_SST25 */
|
||||||
|
|
||||||
#ifdef HAVE_USBMONITOR
|
#ifdef HAVE_USBMONITOR
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Start the USB Monitor */
|
/* Start the USB Monitor */
|
||||||
|
|
||||||
ret = usbmonitor_start(0, NULL);
|
ret = usbmonitor_start(0, NULL);
|
||||||
@@ -276,8 +293,10 @@ int board_app_initialize(void)
|
|||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_app_initialzed = true;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,15 +309,9 @@ int board_app_initialize(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOARDCTL_USBDEVCTRL
|
||||||
int board_usbmsc_initialize(int port)
|
int board_usbmsc_initialize(int port)
|
||||||
{
|
{
|
||||||
#if 1 /* defined(CONFIG_LIB_BOARDCTL) */
|
|
||||||
/* REVIST: CONFIG_LIB_BOARDCTL is not a sufficient condition to determine
|
|
||||||
* board_app_initialize() has already been called or not.
|
|
||||||
*/
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
#else
|
|
||||||
return board_app_initialize();
|
return board_app_initialize();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user