mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +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
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static bool g_app_initialzed;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -130,13 +136,20 @@
|
||||
|
||||
int board_app_initialize(void)
|
||||
{
|
||||
/* Check if already initialized */
|
||||
|
||||
if (g_app_initialzed)
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SST25
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
int ret;
|
||||
|
||||
/* Configure SPI-based devices */
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||
@@ -181,6 +194,7 @@ int board_app_initialize(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPARK_MOUNT_FLASH
|
||||
{
|
||||
char partname[16];
|
||||
char mntpoint[16];
|
||||
|
||||
@@ -199,7 +213,7 @@ int board_app_initialize(void)
|
||||
fdbg("ERROR: Failed to mount the FAT volume: %d\n", errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
{
|
||||
@@ -265,10 +279,13 @@ int board_app_initialize(void)
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_SPARK_FLASH_PART */
|
||||
|
||||
}
|
||||
#endif /* HAVE_SST25 */
|
||||
|
||||
#ifdef HAVE_USBMONITOR
|
||||
{
|
||||
int ret;
|
||||
|
||||
/* Start the USB Monitor */
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
g_app_initialzed = true;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -290,15 +309,9 @@ int board_app_initialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_USBDEVCTRL
|
||||
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();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user