All USB Composite-related files under nuttx/configs changed to use the corrected syslog interfaces
This commit is contained in:
parent
a9fa023ae1
commit
2199c2b1fc
@ -42,7 +42,6 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "fire-internal.h"
|
||||
|
||||
@ -56,26 +55,6 @@
|
||||
# define CONFIG_SYSTEM_COMPOSITE_DEVMINOR1 0
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
@ -71,26 +71,6 @@
|
||||
# error "Unrecognized LPC214x board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -119,35 +99,36 @@ int composite_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("composite_archinitialize: Initializing SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n", LPC214X_MMCSDSPIPORTNO);
|
||||
|
||||
spi = up_spiinitialize(LPC214X_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
{
|
||||
message("composite_archinitialize: Failed to initialize SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
message("composite_archinitialize: Successfully initialized SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO);
|
||||
|
||||
/* Bind the SPI port to the slot */
|
||||
|
||||
message("composite_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_COMPOSITE_DEVMINOR1, LPC214X_MMCSDSLOTNO, spi);
|
||||
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_COMPOSITE_DEVMINOR1,
|
||||
LPC214X_MMCSDSLOTNO, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
message("composite_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
message("composite_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
|
||||
LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO);
|
||||
|
||||
#endif /* CONFIG_NSH_BUILTIN_APPS */
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "shenzhou-internal.h"
|
||||
|
||||
@ -56,26 +55,6 @@
|
||||
# define CONFIG_SYSTEM_COMPOSITE_DEVMINOR1 0
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
@ -116,22 +116,6 @@
|
||||
# undef HAVE_USBMONITOR
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# else
|
||||
# define message printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
@ -155,33 +139,31 @@ static int do_composite_archinitialize(void)
|
||||
|
||||
/* Get the SPI port */
|
||||
|
||||
message("nsh_archinitialize: Initializing SPI port %d\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
fvdbg("Initializing SPI port %d\n", CONFIG_SPARK_FLASH_SPI);
|
||||
|
||||
spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI);
|
||||
if (!spi)
|
||||
{
|
||||
message("nsh_archinitialize: ERROR: Failed to initialize SPI port %d\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
fdbg("ERROR: Failed to initialize SPI port %d\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
message("nsh_archinitialize: Successfully initialized SPI port %d\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
fvdbg("Successfully initialized SPI port %d\n", CONFIG_SPARK_FLASH_SPI);
|
||||
|
||||
/* Now bind the SPI interface to the SST25 SPI FLASH driver */
|
||||
|
||||
message("nsh_archinitialize: Bind SPI to the SPI flash driver\n");
|
||||
fvdbg("Bind SPI to the SPI flash driver\n");
|
||||
mtd = sst25_initialize(spi);
|
||||
if (!mtd)
|
||||
{
|
||||
message("nsh_archinitialize: Failed to bind SPI port %d to the SPI FLASH driver\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
fdbg("ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
}
|
||||
else
|
||||
{
|
||||
message("nsh_archinitialize: Successfully bound SPI port %d to the SPI FLASH driver\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
fvdbg("Successfully bound SPI port %d to the SPI FLASH driver\n",
|
||||
CONFIG_SPARK_FLASH_SPI);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SPARK_FLASH_PART
|
||||
@ -289,7 +271,7 @@ static int do_composite_archinitialize(void)
|
||||
ret = usbmonitor_start(0, NULL);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("nsh_archinitialize: Start USB monitor: %d\n", ret);
|
||||
fdbg("ERROR: Failed to start USB monitor: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -75,26 +75,6 @@
|
||||
# error "Unrecognized STM32 board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -110,7 +90,7 @@
|
||||
int composite_archinitialize(void)
|
||||
{
|
||||
/* If system/composite is built as an NSH command, then SD slot should
|
||||
* already have been initized in nsh_archinitialize() (see up_nsh.c). In
|
||||
* already have been initialized in nsh_archinitialize() (see up_nsh.c). In
|
||||
* this case, there is nothing further to be done here.
|
||||
*
|
||||
* NOTE: CONFIG_NSH_BUILTIN_APPS is not a fool-proof indication that NSH
|
||||
@ -123,30 +103,31 @@ int composite_archinitialize(void)
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
message("composite_archinitialize: Initializing SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO);
|
||||
|
||||
sdio = sdio_initialize(STM32_MMCSDSLOTNO);
|
||||
if (!sdio)
|
||||
{
|
||||
message("composite_archinitialize: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
|
||||
message("composite_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_COMPOSITE_DEVMINOR1);
|
||||
syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_COMPOSITE_DEVMINOR1);
|
||||
|
||||
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_COMPOSITE_DEVMINOR1, sdio);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("composite_archinitialize: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
message("composite_archinitialize: Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. I need to check to
|
||||
* see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/sdio.h>
|
||||
@ -75,27 +75,6 @@
|
||||
# error "Unrecognized STM32 board"
|
||||
#endif
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message(...) lowsyslog(__VA_ARGS__)
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message(...) printf(__VA_ARGS__)
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG
|
||||
# define message lowsyslog
|
||||
# define msgflush()
|
||||
# else
|
||||
# define message printf
|
||||
# define msgflush() fflush(stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -115,42 +94,39 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Initializing SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO);
|
||||
|
||||
sdio = sdio_initialize(STM32_MMCSDSLOTNO);
|
||||
if (!sdio)
|
||||
{
|
||||
message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
|
||||
STM32_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SPI interface to the MMC/SD driver */
|
||||
|
||||
message("usbmsc_archinitialize: "
|
||||
"Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
|
||||
CONFIG_SYSTEM_USBMSC_DEVMINOR1);
|
||||
|
||||
ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio);
|
||||
if (ret != OK)
|
||||
{
|
||||
message("usbmsc_archinitialize: "
|
||||
"Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
message("usbmsc_archinitialize: "
|
||||
"Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. I need to check to
|
||||
* see if the VSN board supports a GPIO to detect if there is a card in
|
||||
* the slot.
|
||||
*/
|
||||
|
||||
sdio_mediachange(sdio, true);
|
||||
return OK;
|
||||
sdio_mediachange(sdio, true);
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_STM32_SDIO */
|
||||
|
Loading…
Reference in New Issue
Block a user