All NSH-related files under nuttx/configs changed to use the corrected syslog interfaces

This commit is contained in:
Gregory Nutt
2014-10-08 14:28:55 -06:00
parent 6a178608fb
commit 4d851b150d
57 changed files with 438 additions and 1266 deletions
+3 -18
View File
@@ -40,7 +40,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include "arduino-due.h" #include "arduino-due.h"
@@ -66,22 +66,6 @@
# endif # endif
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -104,7 +88,8 @@ int nsh_archinitialize(void)
int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR); int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n", syslog(LOG_ERR,
"nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n",
ret); ret);
return ret; return ret;
} }
+3 -19
View File
@@ -43,7 +43,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@@ -97,22 +97,6 @@
# undef HAVE_USBHOST # undef HAVE_USBHOST
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -137,7 +121,7 @@ int nsh_archinitialize(void)
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR); ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize W25 minor %d: %d\n",
CONFIG_NSH_W25MINOR, ret); CONFIG_NSH_W25MINOR, ret);
return ret; return ret;
} }
@@ -151,7 +135,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
+1 -17
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "demo9s12ne64.h" #include "demo9s12ne64.h"
@@ -50,22 +50,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* 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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+9 -22
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_LPC31_MCI #ifdef CONFIG_LPC31_MCI
@@ -96,22 +96,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -132,27 +116,30 @@ int nsh_archinitialize(void)
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("nsh_archinitialize: Initializing SDIO slot %d\n", syslog(LOG_INFO, "Initializing SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SPI interface to the MMC/SD driver */ /* Now bind the SPI interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
message("nsh_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 /* Then let's guess and say that there is a card in the slot. I need to check to
* see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in * see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in
+9 -22
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_LPC31_MCI #ifdef CONFIG_LPC31_MCI
@@ -96,22 +96,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -132,27 +116,30 @@ int nsh_archinitialize(void)
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("nsh_archinitialize: Initializing SDIO slot %d\n", syslog(LOG_INFO, "Initializing SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SPI interface to the MMC/SD driver */ /* Now bind the SPI interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
message("nsh_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 /* Then let's guess and say that there is a card in the slot. I need to check to
* see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in * see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in
+7 -23
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
} }
+1 -19
View File
@@ -42,31 +42,13 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* 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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+3 -19
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@@ -123,22 +123,6 @@
# undef HAVE_USBDEV # undef HAVE_USBDEV
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -163,7 +147,7 @@ int nsh_archinitialize(void)
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR); ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize W25 minor %d: %d\n",
CONFIG_NSH_W25MINOR, ret); CONFIG_NSH_W25MINOR, ret);
return ret; return ret;
} }
@@ -175,7 +159,7 @@ int nsh_archinitialize(void)
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR); ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
+1 -17
View File
@@ -41,29 +41,13 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <syslog.h>
#ifdef CONFIG_NSH_LIBRARY #ifdef CONFIG_NSH_LIBRARY
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message(...) lowsyslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message lowsyslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
+9 -24
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
@@ -68,7 +68,6 @@
#undef CONFIG_STM32_SPI1 #undef CONFIG_STM32_SPI1
/* Check if we can have USB device in NSH */ /* Check if we can have USB device in NSH */
#define NSH_HAVEUSBDEV 1 #define NSH_HAVEUSBDEV 1
@@ -104,23 +103,6 @@
# endif # endif
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -190,27 +172,30 @@ int nsh_archinitialize(void)
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("nsh_archinitialize: Initializing SDIO slot %d\n", syslog(LOG_INFO, "Initializing SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
g_sdiodev = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); g_sdiodev = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_sdiodev) if (!g_sdiodev)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SDIO interface to the MMC/SD driver */ /* Now bind the SDIO interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdiodev); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdiodev);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
dbg("nsh_archinitialize: Successfully bound SDIO to the MMC/SD driver\n");
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
/* Use SD card detect pin to check if a card is inserted */ /* Use SD card detect pin to check if a card is inserted */
+7 -22
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_KINETIS_SDHC #ifdef CONFIG_KINETIS_SDHC
@@ -105,22 +105,6 @@
# error "CONFIG_KINETIS_PORTEINTS required for card detect interrupt" # error "CONFIG_KINETIS_PORTEINTS required for card detect interrupt"
#endif #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 Types * Private Types
****************************************************************************/ ****************************************************************************/
@@ -222,29 +206,30 @@ int nsh_archinitialize(void)
/* Mount the SDHC-based MMC/SD block driver */ /* Mount the SDHC-based MMC/SD block driver */
/* First, get an instance of the SDHC interface */ /* First, get an instance of the SDHC interface */
message("nsh_archinitialize: Initializing SDHC slot %d\n", syslog(LOG_INFO, "Initializing SDHC slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
g_nsh.sdhc = sdhc_initialize(CONFIG_NSH_MMCSDSLOTNO); g_nsh.sdhc = sdhc_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_nsh.sdhc) if (!g_nsh.sdhc)
{ {
message("nsh_archinitialize: Failed to initialize SDHC slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDHC slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SDHC interface to the MMC/SD driver */ /* Now bind the SDHC interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDHC to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDHC to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret);
return ret; return ret;
} }
message("nsh_archinitialize: Successfully bound SDHC to the MMC/SD driver\n");
syslog(LOG_INFO, "Successfully bound SDHC to the MMC/SD driver\n");
/* Handle the initial card state */ /* Handle the initial card state */
+1 -18
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -50,23 +50,6 @@
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* 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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
+1 -19
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -51,24 +51,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* 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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+7 -23
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
} }
+7 -23
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
} }
+1 -17
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -68,22 +68,6 @@
# undef NSH_HAVEUSBDEV # undef NSH_HAVEUSBDEV
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+1 -1
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "chip.h" #include "chip.h"
+5 -21
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -99,22 +99,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -146,12 +130,12 @@ int nsh_archinitialize(void)
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO); ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp) if (!ssp)
{ {
message("nsh_archinitialize: Failed to initialize SSP port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SSP port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("Successfully initialized SSP port %d\n", syslog(LOG_INFO, "Successfully initialized SSP port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */ /* Bind the SSP port to the slot */
@@ -159,12 +143,12 @@ int nsh_archinitialize(void)
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SSP port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("Successfuly bound SSP port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
#endif #endif
return OK; return OK;
+1 -17
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -68,22 +68,6 @@
# undef NSH_HAVEUSBDEV # undef NSH_HAVEUSBDEV
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+7 -23
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
} }
+16 -30
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
@@ -147,22 +147,6 @@
# endif # endif
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -192,28 +176,29 @@ int nsh_archinitialize(void)
#ifdef CONFIG_STM32_SPI3 #ifdef CONFIG_STM32_SPI3
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port 3\n"); syslog(LOG_INFO, "Initializing SPI port 3\n");
spi = up_spiinitialize(3); spi = up_spiinitialize(3);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port 3\n"); syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 3\n");
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port 3\n"); syslog(LOG_INFO, "Successfully initialized SPI port 3\n");
/* Now bind the SPI interface to the M25P8 SPI FLASH driver */ /* Now bind the SPI interface to the M25P8 SPI FLASH driver */
#if defined(CONFIG_MTD) && defined(CONFIG_MIKROE_FLASH) #if defined(CONFIG_MTD) && defined(CONFIG_MIKROE_FLASH)
message("nsh_archinitialize: Bind SPI to the SPI flash driver\n"); syslog(LOG_INFO, "Bind SPI to the SPI flash driver\n");
mtd = m25p_initialize(spi); mtd = m25p_initialize(spi);
if (!mtd) if (!mtd)
{ {
message("nsh_archinitialize: Failed to bind SPI port 3 to the SPI FLASH driver\n"); syslog(LOG_ERR, "ERROR: Failed to bind SPI port 3 to the SPI FLASH driver\n");
} }
else else
{ {
message("nsh_archinitialize: Successfully bound SPI port 3 to the SPI FLASH driver\n"); syslog(LOG_INFO, "Successfully bound SPI port 3 to the SPI FLASH driver\n");
#ifdef CONFIG_MIKROE_FLASH_PART #ifdef CONFIG_MIKROE_FLASH_PART
{ {
@@ -317,16 +302,17 @@ int nsh_archinitialize(void)
#ifdef NSH_HAVEMMCSD #ifdef NSH_HAVEMMCSD
/* Bind the spi interface to the MMC/SD driver */ /* Bind the spi interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to bind SPI to the MMC/SD driver: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to bind SPI to the MMC/SD driver: %d\n", ret);
} }
else else
{ {
message("nsh_archinitialize: Successfully bound SPI to the MMC/SD driver\n"); syslog(LOG_INFO, "Successfully bound SPI to the MMC/SD driver\n");
} }
#endif #endif
@@ -338,7 +324,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -349,19 +335,19 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif
#if defined(CONFIG_LCD_MIO283QT2) || defined(CONFIG_LCD_MIO283QT9A) #if defined(CONFIG_LCD_MIO283QT2) || defined(CONFIG_LCD_MIO283QT9A)
/* Configure the TFT LCD module */ /* Configure the TFT LCD module */
message("nsh_archinitialize: Initializing TFT LCD module\n"); syslog(LOG_INFO, "Initializing TFT LCD module\n");
ret = up_lcdinitialize(); ret = up_lcdinitialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize TFT LCD module\n"); syslog(LOG_ERR, "ERROR: Failed to initialize TFT LCD module\n");
} }
#endif #endif
+1 -1
View File
@@ -45,7 +45,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <syslog.h>
#ifdef CONFIG_PIC32MX_SPI2 #ifdef CONFIG_PIC32MX_SPI2
# include <nuttx/spi/spi.h> # include <nuttx/spi/spi.h>
+1 -17
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "ne64badge_internal.h" #include "ne64badge_internal.h"
@@ -50,22 +50,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* 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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+6 -21
View File
@@ -40,7 +40,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
@@ -57,23 +57,6 @@
/**************************************************************************** /****************************************************************************
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* 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 Data * Private Data
@@ -127,7 +110,7 @@ int nsh_archinitialize(void)
g_sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); g_sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_sdio) if (!g_sdio)
{ {
message("[boot] Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
@@ -137,7 +120,9 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdio);
if (ret != OK) if (ret != OK)
{ {
message("ERROR: 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; return ret;
} }
@@ -147,7 +132,7 @@ int nsh_archinitialize(void)
sdio_mediachange(g_sdio, true); sdio_mediachange(g_sdio, true);
message("[boot] Initialized SDIO\n"); syslog(LOG_INFO, "[boot] Initialized SDIO\n");
#endif #endif
return OK; return OK;
+5 -21
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -93,22 +93,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -139,12 +123,12 @@ int nsh_archinitialize(void)
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO); ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp) if (!ssp)
{ {
message("nsh_archinitialize: Failed to initialize SSP port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SSP port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("Successfully initialized SSP port %d\n", syslog(LOG_INFO, "Successfully initialized SSP port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */ /* Bind the SSP port to the slot */
@@ -152,12 +136,12 @@ int nsh_archinitialize(void)
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SSP port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("Successfuly bound SSP port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
+7 -23
View File
@@ -41,7 +41,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
@@ -69,22 +69,6 @@
# endif # endif
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -106,11 +90,11 @@ int nsh_archinitialize(void)
#ifdef HAVE_MMCSD #ifdef HAVE_MMCSD
/* Create the SDIO-based MMC/SD device */ /* Create the SDIO-based MMC/SD device */
message("nsh_archinitialize: Create the MMC/SD device\n"); syslog(LOG_INFO, "Create the MMC/SD device\n");
ret = lpc31_mmcsd_initialize(CONFIG_NSH_MMCSDSLOTNO); ret = lpc31_mmcsd_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO, CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDSLOTNO, CONFIG_NSH_MMCSDMINOR);
return -ENODEV; return -ENODEV;
} }
@@ -121,11 +105,11 @@ int nsh_archinitialize(void)
* will monitor for USB connection and disconnection events. * will monitor for USB connection and disconnection events.
*/ */
message("nsh_archinitialize: Start USB host services\n"); syslog(LOG_INFO, "Start USB host services\n");
ret = lpc31_usbhost_initialize(); ret = lpc31_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("ERROR: Failed to start USB host services: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB host services: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -133,11 +117,11 @@ int nsh_archinitialize(void)
#ifdef HAVE_USBMONITOR #ifdef HAVE_USBMONITOR
/* Start the USB Monitor */ /* Start the USB Monitor */
message("nsh_archinitialize: Start the USB monitor\n"); syslog(LOG_ERR, "ERROR: Failed to start the USB monitor\n");
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif
+13 -28
View File
@@ -41,7 +41,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -117,22 +117,6 @@
# endif # endif
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -158,7 +142,7 @@ static int nsh_waiter(int argc, char *argv[])
{ {
bool connected = false; bool connected = false;
message("nsh_waiter: Running\n"); syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;) for (;;)
{ {
/* Wait for the device to change state */ /* Wait for the device to change state */
@@ -166,7 +150,7 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGVERIFY(CONN_WAIT(g_usbconn, &connected)); DEBUGVERIFY(CONN_WAIT(g_usbconn, &connected));
connected = !connected; connected = !connected;
message("nsh_waiter: %s\n", connected ? "connected" : "disconnected"); syslog(LOG_INFO, "%s\n", connected ? "connected" : "disconnected");
/* Did we just become connected? */ /* Did we just become connected? */
@@ -207,13 +191,13 @@ static int nsh_sdinitialize(void)
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO); ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp) if (!ssp)
{ {
message("nsh_archinitialize: Failed to initialize SSP port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SSP port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
ret = -ENODEV; ret = -ENODEV;
goto errout; goto errout;
} }
message("Successfully initialized SSP port %d\n", syslog(LOG_INFO, "Successfully initialized SSP port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */ /* Bind the SSP port to the slot */
@@ -222,14 +206,14 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, ssp); CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0) if (ret < 0)
{ {
message("nsh_sdinitialize: " syslog(LOG_ERR,
"Failed to bind SSP port %d to MMC/SD slot %d: %d\n", "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSPIPORTNO,
CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout; goto errout;
} }
message("Successfuly bound SSP port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfully bound SSP port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSPIPORTNO,
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
@@ -262,28 +246,29 @@ static int nsh_usbhostinitialize(void)
* that we care about: * that we care about:
*/ */
message("nsh_usbhostinitialize: Register class drivers\n"); syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit(); ret = usbhost_storageinit();
if (ret != OK) if (ret != OK)
{ {
message("nsh_usbhostinitialize: Failed to register the mass storage class\n"); syslog(LOG_ERR, "ERROR: Failed to register the mass storage class\n");
} }
/* Then get an instance of the USB host interface */ /* Then get an instance of the USB host interface */
message("nsh_usbhostinitialize: Initialize USB host\n"); syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = lpc17_usbhost_initialize(0); g_usbconn = lpc17_usbhost_initialize(0);
if (g_usbconn) if (g_usbconn)
{ {
/* Start a thread to handle device connection. */ /* Start a thread to handle device connection. */
message("nsh_usbhostinitialize: Start nsh_waiter\n"); syslog(LOG_ERR, "ERROR: Start nsh_waiter\n");
pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE, CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL); (main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK; return pid < 0 ? -ENOEXEC : OK;
} }
return -ENODEV; return -ENODEV;
} }
#else #else
+1 -17
View File
@@ -46,7 +46,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -79,22 +79,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+3 -21
View File
@@ -41,7 +41,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
@@ -59,24 +59,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message(...) lowsyslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message lowsyslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -108,7 +90,7 @@ int nsh_archinitialize(void)
ret = stm32_can_initialize(); ret = stm32_can_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize CAN: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret);
} }
#endif #endif
@@ -118,7 +100,7 @@ int nsh_archinitialize(void)
ret = stm32_adc_initialize(); ret = stm32_adc_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize ADC: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret);
} }
#endif #endif
+5 -21
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
@@ -93,22 +93,6 @@
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message(...) lowsyslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message lowsyslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -140,7 +124,7 @@ int nsh_archinitialize(void)
ret = stm32_can_initialize(); ret = stm32_can_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize CAN: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize CAN: %d\n", ret);
} }
#endif #endif
@@ -150,7 +134,7 @@ int nsh_archinitialize(void)
ret = stm32_adc_initialize(); ret = stm32_adc_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize ADC: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize ADC: %d\n", ret);
} }
#endif #endif
@@ -162,7 +146,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -173,7 +157,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif
+7 -23
View File
@@ -41,7 +41,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -95,22 +95,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -131,34 +115,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
#endif #endif
+11 -27
View File
@@ -42,7 +42,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
@@ -143,22 +143,6 @@
# undef NSH_HAVE_USBDEV # undef NSH_HAVE_USBDEV
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message(...) lowsyslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message lowsyslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -188,7 +172,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false; bool connected = false;
int ret; int ret;
message("nsh_waiter: Running\n"); syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;) for (;;)
{ {
/* Wait for the device to change state */ /* Wait for the device to change state */
@@ -197,7 +181,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK); DEBUGASSERT(ret == OK);
connected = !connected; connected = !connected;
message("nsh_waiter: %s\n", connected ? "connected" : "disconnected"); syslog(LOG_INFO, "nsh_waiter: %s\n",
connected ? "connected" : "disconnected");
/* Did we just become connected? */ /* Did we just become connected? */
@@ -275,7 +260,7 @@ static int nsh_sdinitialize(void)
g_sdiodev = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); g_sdiodev = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_sdiodev) if (!g_sdiodev)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
@@ -285,10 +270,9 @@ static int nsh_sdinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdiodev); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdiodev);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: " syslog(LOG_ERR,
"Failed to bind SDIO to the MMC/SD driver: %d\n", "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret); ret);
return ret; return ret;
} }
@@ -326,22 +310,22 @@ static int nsh_usbhostinitialize(void)
* that we care about: * that we care about:
*/ */
message("nsh_usbhostinitialize: Register class drivers\n"); syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit(); ret = usbhost_storageinit();
if (ret != OK) if (ret != OK)
{ {
message("nsh_usbhostinitialize: Failed to register the mass storage class\n"); syslog(LOG_ERR, "ERROR: Failed to register the mass storage class\n");
} }
/* Then get an instance of the USB host interface */ /* Then get an instance of the USB host interface */
message("nsh_usbhostinitialize: Initialize USB host\n"); syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = lpc17_usbhost_initialize(0); g_usbconn = lpc17_usbhost_initialize(0);
if (g_usbconn) if (g_usbconn)
{ {
/* Start a thread to handle device connection. */ /* Start a thread to handle device connection. */
message("nsh_usbhostinitialize: Start nsh_waiter\n"); syslog(LOG_INFO, "Start nsh_waiter\n");
pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE, CONFIG_USBHOST_STACKSIZE,
+1 -17
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <debug.h> #include <syslog.h>
#include <nuttx/lcd/hd4478ou.h> #include <nuttx/lcd/hd4478ou.h>
#include <arch/board/board.h> #include <arch/board/board.h>
@@ -56,22 +56,6 @@
# define OK 0 # define OK 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
+14 -28
View File
@@ -42,7 +42,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -150,22 +150,6 @@
# endif # endif
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -192,7 +176,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false; bool connected = false;
int ret; int ret;
message("nsh_waiter: Running\n"); syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;) for (;;)
{ {
/* Wait for the device to change state */ /* Wait for the device to change state */
@@ -201,7 +185,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK); DEBUGASSERT(ret == OK);
connected = !connected; connected = !connected;
message("nsh_waiter: %s\n", connected ? "connected" : "disconnected"); syslog(LOG_INFO, "nsh_waiter: %s\n",
connected ? "connected" : "disconnected");
/* Did we just become connected? */ /* Did we just become connected? */
@@ -238,13 +223,13 @@ static int nsh_sdinitialize(void)
ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp) if (!ssp)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
ret = -ENODEV; ret = -ENODEV;
goto errout; goto errout;
} }
message("Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */ /* Bind the SPI port to the slot */
@@ -253,14 +238,14 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, ssp); CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0) if (ret < 0)
{ {
message("nsh_sdinitialize: " syslog(LOG_ERR,
"Failed to bind SPI port %d to MMC/SD slot %d: %d\n", "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSPIPORTNO,
CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout; goto errout;
} }
message("Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSPIPORTNO,
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
@@ -290,28 +275,29 @@ static int nsh_usbhostinitialize(void)
* that we care about: * that we care about:
*/ */
message("nsh_usbhostinitialize: Register class drivers\n"); syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit(); ret = usbhost_storageinit();
if (ret != OK) if (ret != OK)
{ {
message("nsh_usbhostinitialize: Failed to register the mass storage class\n"); syslog(LOG_ERR, "ERROR: Failed to register the mass storage class\n");
} }
/* Then get an instance of the USB host interface */ /* Then get an instance of the USB host interface */
message("nsh_usbhostinitialize: Initialize USB host\n"); syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = pic32_usbhost_initialize(0); g_usbconn = pic32_usbhost_initialize(0);
if (g_usbconn) if (g_usbconn)
{ {
/* Start a thread to handle device connection. */ /* Start a thread to handle device connection. */
message("nsh_usbhostinitialize: Start nsh_waiter\n"); syslog(LOG_INFO, "Start nsh_waiter\n");
pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE, CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL); (main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK; return pid < 0 ? -ENOEXEC : OK;
} }
return -ENODEV; return -ENODEV;
} }
#else #else
+16 -28
View File
@@ -42,7 +42,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/spi/spi.h> #include <nuttx/spi/spi.h>
@@ -149,22 +149,6 @@
# endif # endif
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -191,7 +175,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false; bool connected = false;
int ret; int ret;
message("nsh_waiter: Running\n"); syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;) for (;;)
{ {
/* Wait for the device to change state */ /* Wait for the device to change state */
@@ -200,7 +184,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK); DEBUGASSERT(ret == OK);
connected = !connected; connected = !connected;
message("nsh_waiter: %s\n", connected ? "connected" : "disconnected"); syslog(LOG_INFO, "nsh_waiter: %s\n",
connected ? "connected" : "disconnected");
/* Did we just become connected? */ /* Did we just become connected? */
@@ -237,13 +222,13 @@ static int nsh_sdinitialize(void)
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO); spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
ret = -ENODEV; ret = -ENODEV;
goto errout; goto errout;
} }
message("Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_NSH_MMCSDSPIPORTNO); CONFIG_NSH_MMCSDSPIPORTNO);
/* The SPI should be in 8-bit (default) and mode2: CKP=1, CKE=0. /* The SPI should be in 8-bit (default) and mode2: CKP=1, CKE=0.
@@ -261,16 +246,18 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, spi); CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("nsh_sdinitialize: " syslog(LOG_ERR,
"Failed to bind SPI port %d to MMC/SD slot %d: %d\n", "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSPIPORTNO,
CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout; goto errout;
} }
message("Successfuly bound SPI port %d to MMC/SD slot %d\n", syslog(LOG_INFO,
"Successfully bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSPIPORTNO,
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return OK; return OK;
errout: errout:
@@ -298,22 +285,22 @@ static int nsh_usbhostinitialize(void)
* that we care about: * that we care about:
*/ */
message("nsh_usbhostinitialize: Register class drivers\n"); syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit(); ret = usbhost_storageinit();
if (ret != OK) if (ret != OK)
{ {
message("nsh_usbhostinitialize: Failed to register the mass storage class\n"); syslog(LOG_ERR, "ERROR: Failed to register the mass storage class\n");
} }
/* Then get an instance of the USB host interface */ /* Then get an instance of the USB host interface */
message("nsh_usbhostinitialize: Initialize USB host\n"); syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = pic32_usbhost_initialize(0); g_usbconn = pic32_usbhost_initialize(0);
if (g_usbconn) if (g_usbconn)
{ {
/* Start a thread to handle device connection. */ /* Start a thread to handle device connection. */
message("nsh_usbhostinitialize: Start nsh_waiter\n"); syslog(LOG_INFO, "Start nsh_waiter\n");
pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO, pid = task_create("usbhost", CONFIG_USBHOST_DEFPRIO,
CONFIG_USBHOST_STACKSIZE, CONFIG_USBHOST_STACKSIZE,
@@ -381,5 +368,6 @@ int nsh_archinitialize(void)
ret = nsh_usbdevinitialize(); ret = nsh_usbdevinitialize();
} }
return ret; return ret;
} }
+9 -22
View File
@@ -41,7 +41,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/sdio.h> #include <nuttx/sdio.h>
@@ -96,22 +96,6 @@
# undef NSH_HAVE_USBDEV # undef NSH_HAVE_USBDEV
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message syslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -133,27 +117,30 @@ int nsh_archinitialize(void)
/* Mount the SDIO-based MMC/SD block driver */ /* Mount the SDIO-based MMC/SD block driver */
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("nsh_archinitialize: Initializing SDIO slot %d\n", syslog(LOG_INFO, "Initializing SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SDIO interface to the MMC/SD driver */ /* Now bind the SDIO interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
message("nsh_archinitialize: Successfully bound SDIO to the MMC/SD driver\n");
syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n");
/* Then inform the HSMCI driver if there is or is not a card in the slot. */ /* Then inform the HSMCI driver if there is or is not a card in the slot. */
+4 -20
View File
@@ -44,7 +44,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <syslog.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h> # include <apps/usbmonitor.h>
@@ -56,22 +56,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message syslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -96,7 +80,7 @@ int nsh_archinitialize(void)
ret = sam_at25_automount(0); ret = sam_at25_automount(0);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount() failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount() failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -107,7 +91,7 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(0); ret = sam_hsmci_initialize(0);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(0) failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(0) failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -118,7 +102,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
return ret; return ret;
} }
#endif #endif
+3 -19
View File
@@ -40,7 +40,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include "sam4l-xplained.h" #include "sam4l-xplained.h"
@@ -69,22 +69,6 @@
# endif # endif
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -106,7 +90,7 @@ int nsh_archinitialize(void)
int ret = sam_slcd_initialize(); int ret = sam_slcd_initialize();
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize the LCD: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize the LCD: %d\n",
ret); ret);
return ret; return ret;
} }
@@ -119,7 +103,7 @@ int nsh_archinitialize(void)
int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR); int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n",
ret); ret);
return ret; return ret;
} }
+23 -27
View File
@@ -45,7 +45,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <syslog.h>
#include <unistd.h> #include <unistd.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
@@ -72,22 +72,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message syslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -108,11 +92,14 @@ int nsh_archinitialize(void)
#endif #endif
#ifdef HAVE_USBDEV #ifdef HAVE_USBDEV
message("Registering CDC/ACM serial driver\n"); syslog(LOG_INFO, "Registering CDC/ACM serial driver\n");
ret = cdcacm_initialize(CONFIG_SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR, NULL); ret = cdcacm_initialize(CONFIG_SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR, NULL);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: Failed to create the CDC/ACM serial device: %d (%d)\n", ret, errno); syslog(LOG_ERR,
"ERROR: Failed to create the CDC/ACM serial device: %d (%d)\n",
ret, errno);
return ret; return ret;
} }
#endif #endif
@@ -120,11 +107,14 @@ int nsh_archinitialize(void)
#ifdef HAVE_HSMCI #ifdef HAVE_HSMCI
/* Initialize the HSMCI driver */ /* Initialize the HSMCI driver */
message("initializing HSMCI\n"); syslog(LOG_INFO, "initializing HSMCI\n");
ret = sam_hsmci_initialize(); ret = sam_hsmci_initialize();
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize() failed: %d (%d)\n", ret, errno); syslog(LOG_ERR,
"ERROR: sam_hsmci_initialize() failed: %d (%d)\n",
ret, errno);
return ret; return ret;
} }
#endif #endif
@@ -132,21 +122,27 @@ int nsh_archinitialize(void)
#ifdef HAVE_PROC #ifdef HAVE_PROC
/* mount the proc filesystem */ /* mount the proc filesystem */
message("Mounting procfs to /proc\n"); syslog(LOG_INFO, "Mounting procfs to /proc\n");
ret = mount(NULL, "/proc", "procfs", 0, NULL); ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: Failed to mount the PROC filesystem: %d (%d)\n", ret, errno); syslog(LOG_ERR,
"ERROR: Failed to mount the PROC filesystem: %d (%d)\n",
ret, errno);
return ret; return ret;
} }
#endif #endif
#if HAVE_HSMCI #if HAVE_HSMCI
message("Mounting /dev/mmcsd0 to /fat\n"); syslog(LOG_INFO, "Mounting /dev/mmcsd0 to /fat\n");
ret = mount("/dev/mmcsd0", "/fat", "vfat", 0, NULL); ret = mount("/dev/mmcsd0", "/fat", "vfat", 0, NULL);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: Failed to mount the FAT filesystem: %d (%d)\n", ret, errno); syslog(LOG_ERR,
"ERROR: Failed to mount the FAT filesystem: %d (%d)\n",
ret, errno);
return ret; return ret;
} }
#endif #endif
@@ -154,11 +150,11 @@ int nsh_archinitialize(void)
#ifdef HAVE_USBMONITOR #ifdef HAVE_USBMONITOR
/* Start the USB Monitor */ /* Start the USB Monitor */
message("Starting USB Monitor\n"); syslog(LOG_INFO, "Starting USB Monitor\n");
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d (%d)\n", ret, errno); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d (%d)\n", ret, errno);
return ret; return ret;
} }
#endif #endif
+7 -23
View File
@@ -44,7 +44,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <syslog.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h> # include <apps/usbmonitor.h>
@@ -56,22 +56,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message syslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -97,7 +81,7 @@ int nsh_archinitialize(void)
ret = sam_nand_automount(NAND_MINOR); ret = sam_nand_automount(NAND_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_nand_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_nand_automount failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -108,7 +92,7 @@ int nsh_archinitialize(void)
ret = sam_at25_automount(AT25_MINOR); ret = sam_at25_automount(AT25_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -120,7 +104,7 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR); ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
HSMCI0_SLOTNO, HSMCI0_MINOR, ret); HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
return ret; return ret;
} }
@@ -132,7 +116,7 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR); ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
HSMCI1_SLOTNO, HSMCI1_MINOR, ret); HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
return ret; return ret;
} }
@@ -147,7 +131,7 @@ int nsh_archinitialize(void)
ret = sam_usbhost_initialize(); ret = sam_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("ERROR: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -158,7 +142,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif
+10 -25
View File
@@ -44,7 +44,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <syslog.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h> # include <apps/usbmonitor.h>
@@ -56,22 +56,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) syslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# ifdef CONFIG_DEBUG
# define message syslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -98,7 +82,7 @@ int nsh_archinitialize(void)
ret = sam_nand_automount(NAND_MINOR); ret = sam_nand_automount(NAND_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_nand_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_nand_automount failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -109,7 +93,7 @@ int nsh_archinitialize(void)
ret = sam_at25_automount(AT25_MINOR); ret = sam_at25_automount(AT25_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at25_automount failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -120,7 +104,7 @@ int nsh_archinitialize(void)
ret = sam_at24_automount(AT24_MINOR); ret = sam_at24_automount(AT24_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at24_automount failed: %d\n", ret); syslog(LOG_ERR, "ERROR: sam_at24_automount failed: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -132,7 +116,7 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR); ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
HSMCI0_SLOTNO, HSMCI0_MINOR, ret); HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
return ret; return ret;
} }
@@ -144,7 +128,7 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR); ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
HSMCI1_SLOTNO, HSMCI1_MINOR, ret); HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
return ret; return ret;
} }
@@ -159,7 +143,7 @@ int nsh_archinitialize(void)
ret = sam_usbhost_initialize(); ret = sam_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("ERROR: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
@@ -170,7 +154,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Start USB monitor: %d\n", ret);
} }
#endif #endif
@@ -180,7 +164,8 @@ int nsh_archinitialize(void)
ret = sam_wm8904_initialize(0); ret = sam_wm8904_initialize(0);
if (ret != OK) if (ret != OK)
{ {
message("ERROR: Failed to initialize WM8904 audio: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize WM8904 audio: %d\n",
ret);
} }
#endif #endif
+2 -18
View File
@@ -40,7 +40,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include "sam_config.h" #include "sam_config.h"
#include "samd20-xplained.h" #include "samd20-xplained.h"
@@ -91,22 +91,6 @@
# endif # endif
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -128,7 +112,7 @@ int nsh_archinitialize(void)
int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n",
ret); ret);
return ret; return ret;
} }
+4 -20
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@@ -145,22 +145,6 @@
# undef HAVE_USBHOST # undef HAVE_USBHOST
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -185,7 +169,7 @@ int nsh_archinitialize(void)
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR); ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize W25 minor %d: %d\n",
CONFIG_NSH_W25MINOR, ret); CONFIG_NSH_W25MINOR, ret);
return ret; return ret;
} }
@@ -197,7 +181,7 @@ int nsh_archinitialize(void)
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR); ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0) if (ret < 0)
{ {
message("nsh_archinitialize: Failed to initialize MMC/SD slot %d: %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
@@ -211,7 +195,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
+9 -24
View File
@@ -43,7 +43,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
@@ -116,22 +116,6 @@
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #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 Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -159,32 +143,33 @@ int nsh_archinitialize(void)
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port %d\n", syslog(LOG_INFO, "Initializing SPI port %d\n",
CONFIG_SPARK_FLASH_SPI); CONFIG_SPARK_FLASH_SPI);
spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI); spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: ERROR: Failed to initialize SPI port %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
CONFIG_SPARK_FLASH_SPI); CONFIG_SPARK_FLASH_SPI);
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port %d\n", syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
CONFIG_SPARK_FLASH_SPI); CONFIG_SPARK_FLASH_SPI);
/* Now bind the SPI interface to the SST25 SPI FLASH driver */ /* Now bind the SPI interface to the SST25 SPI FLASH driver */
message("nsh_archinitialize: Bind SPI to the SPI flash driver\n"); syslog(LOG_INFO, "Bind SPI to the SPI flash driver\n");
mtd = sst25_initialize(spi); mtd = sst25_initialize(spi);
if (!mtd) if (!mtd)
{ {
message("nsh_archinitialize: Failed to bind SPI port %d to the SPI FLASH driver\n", syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n",
CONFIG_SPARK_FLASH_SPI); CONFIG_SPARK_FLASH_SPI);
} }
else else
{ {
message("nsh_archinitialize: Successfully bound SPI port %d to the SPI FLASH driver\n", syslog(LOG_INFO, "Successfully bound SPI port %d to the SPI FLASH driver\n",
CONFIG_SPARK_FLASH_SPI); CONFIG_SPARK_FLASH_SPI);
} }
@@ -293,7 +278,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif
+16 -28
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
@@ -104,22 +104,6 @@
# define CONFIG_NSH_MMCSDMINOR 0 # define CONFIG_NSH_MMCSDMINOR 0
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -148,25 +132,27 @@ int nsh_archinitialize(void)
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port 1\n"); syslog(LOG_INFO, "Initializing SPI port 1\n");
spi = up_spiinitialize(1); spi = up_spiinitialize(1);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port 0\n"); syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n");
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port 0\n"); syslog(LOG_INFO, "Successfully initialized SPI port 0\n");
/* Now bind the SPI interface to the M25P64/128 SPI FLASH driver */ /* Now bind the SPI interface to the M25P64/128 SPI FLASH driver */
message("nsh_archinitialize: Bind SPI to the SPI flash driver\n"); syslog(LOG_INFO, "Bind SPI to the SPI flash driver\n");
mtd = m25p_initialize(spi); mtd = m25p_initialize(spi);
if (!mtd) if (!mtd)
{ {
message("nsh_archinitialize: Failed to bind SPI port 0 to the SPI FLASH driver\n"); syslog(LOG_ERR, "ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n");
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully bound SPI port 0 to the SPI FLASH driver\n");
syslog(LOG_INFO, "Successfully bound SPI port 0 to the SPI FLASH driver\n");
#warning "Now what are we going to do with this SPI FLASH driver?" #warning "Now what are we going to do with this SPI FLASH driver?"
#endif #endif
@@ -180,27 +166,29 @@ int nsh_archinitialize(void)
#ifdef NSH_HAVEMMCSD #ifdef NSH_HAVEMMCSD
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("nsh_archinitialize: Initializing SDIO slot %d\n", syslog(LOG_INFO, "Initializing SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
/* Now bind the SDIO interface to the MMC/SD driver */ /* Now bind the SDIO interface to the MMC/SD driver */
message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n", syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
CONFIG_NSH_MMCSDMINOR); CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
message("nsh_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 /* 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 * see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in
+6 -24
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
@@ -118,22 +118,6 @@
# undef HAVE_USBHOST # undef HAVE_USBHOST
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -167,7 +151,7 @@ int nsh_archinitialize(void)
spi = up_spiinitialize(1); spi = up_spiinitialize(1);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port 0\n"); syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n");
return -ENODEV; return -ENODEV;
} }
@@ -176,7 +160,7 @@ int nsh_archinitialize(void)
mtd = m25p_initialize(spi); mtd = m25p_initialize(spi);
if (!mtd) if (!mtd)
{ {
message("nsh_archinitialize: Failed to bind SPI port 0 to the SPI FLASH driver\n"); syslog(LOG_ERR, "ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n");
return -ENODEV; return -ENODEV;
} }
@@ -188,12 +172,10 @@ int nsh_archinitialize(void)
#ifdef HAVE_MMCSD #ifdef HAVE_MMCSD
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
message("nsh_archinitialize: Initializing SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO);
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
@@ -203,7 +185,7 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
@@ -223,7 +205,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
+6 -22
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_STM32_SPI1 #ifdef CONFIG_STM32_SPI1
@@ -124,22 +124,6 @@
# undef HAVE_USBHOST # undef HAVE_USBHOST
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -173,7 +157,7 @@ int nsh_archinitialize(void)
spi = up_spiinitialize(1); spi = up_spiinitialize(1);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port 0\n"); syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n");
return -ENODEV; return -ENODEV;
} }
@@ -182,7 +166,7 @@ int nsh_archinitialize(void)
mtd = m25p_initialize(spi); mtd = m25p_initialize(spi);
if (!mtd) if (!mtd)
{ {
message("nsh_archinitialize: Failed to bind SPI port 0 to the SPI FLASH driver\n"); syslog(LOG_ERR, "ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n");
return -ENODEV; return -ENODEV;
} }
#warning "Now what are we going to do with this SPI FLASH driver?" #warning "Now what are we going to do with this SPI FLASH driver?"
@@ -196,7 +180,7 @@ int nsh_archinitialize(void)
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
@@ -206,7 +190,7 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) if (ret != OK)
{ {
message("nsh_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; return ret;
} }
@@ -226,7 +210,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
#endif #endif
+2 -18
View File
@@ -41,7 +41,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include "stm32.h" #include "stm32.h"
@@ -51,22 +51,6 @@
* Pre-Processor Definitions * Pre-Processor Definitions
****************************************************************************/ ****************************************************************************/
/* 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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -82,7 +66,7 @@
int nsh_archinitialize(void) int nsh_archinitialize(void)
{ {
#if defined(CONFIG_WL_NRF24L01) #if defined(CONFIG_WL_NRF24L01)
message("Register the nRF24L01 module"); syslog(LOG_INFO, "Register the nRF24L01 module");
up_wlinitialize(); up_wlinitialize();
#endif #endif
+2 -18
View File
@@ -42,7 +42,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #ifdef CONFIG_SYSTEM_USBMONITOR
@@ -83,22 +83,6 @@
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #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
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -121,7 +105,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif
+12 -26
View File
@@ -41,7 +41,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <debug.h> #include <syslog.h>
#include <errno.h> #include <errno.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
@@ -112,22 +112,6 @@
# undef HAVE_USBMONITOR # undef HAVE_USBMONITOR
#endif #endif
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message(...) lowsyslog(__VA_ARGS__)
# else
# define message(...) printf(__VA_ARGS__)
# endif
#else
# if defined(CONFIG_DEBUG) || !defined(CONFIG_NSH_ARCHINIT)
# define message lowsyslog
# else
# define message printf
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
@@ -165,15 +149,16 @@ int nsh_archinitialize(void)
#ifdef CONFIG_STM32_SPI4 #ifdef CONFIG_STM32_SPI4
/* Get the SPI port */ /* Get the SPI port */
message("nsh_archinitialize: Initializing SPI port 4\n"); syslog(LOG_INFO, "Initializing SPI port 4\n");
spi = up_spiinitialize(4); spi = up_spiinitialize(4);
if (!spi) if (!spi)
{ {
message("nsh_archinitialize: Failed to initialize SPI port 4\n"); syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 4\n");
return -ENODEV; return -ENODEV;
} }
message("nsh_archinitialize: Successfully initialized SPI port 4\n"); syslog(LOG_INFO, "Successfully initialized SPI port 4\n");
/* Now bind the SPI interface to the SST25F064 SPI FLASH driver. This /* Now bind the SPI interface to the SST25F064 SPI FLASH driver. This
* is a FLASH device that has been added external to the board (i.e. * is a FLASH device that has been added external to the board (i.e.
@@ -181,15 +166,16 @@ int nsh_archinitialize(void)
*/ */
#if defined(CONFIG_MTD) && defined(CONFIG_MTD_SST25XX) #if defined(CONFIG_MTD) && defined(CONFIG_MTD_SST25XX)
message("nsh_archinitialize: Bind SPI to the SPI flash driver\n"); syslog(LOG_INFO, "Bind SPI to the SPI flash driver\n");
mtd = sst25xx_initialize(spi); mtd = sst25xx_initialize(spi);
if (!mtd) if (!mtd)
{ {
message("nsh_archinitialize: Failed to bind SPI port 4 to the SPI FLASH driver\n"); syslog(LOG_ERR, "ERROR: Failed to bind SPI port 4 to the SPI FLASH driver\n");
} }
else else
{ {
message("nsh_archinitialize: Successfully bound SPI port 4 to the SPI FLASH driver\n"); syslog(LOG_INFO, "Successfully bound SPI port 4 to the SPI FLASH driver\n");
#ifdef CONFIG_STM32F429I_DISCO_FLASH_PART #ifdef CONFIG_STM32F429I_DISCO_FLASH_PART
{ {
@@ -314,7 +300,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret; return ret;
} }
@@ -324,7 +310,7 @@ int nsh_archinitialize(void)
ret = usbhost_storageinit(); ret = usbhost_storageinit();
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Failed to initialize USB host storage: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host storage: %d\n", ret);
return ret; return ret;
} }
@@ -338,7 +324,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) if (ret != OK)
{ {
message("nsh_archinitialize: Start USB monitor: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
} }
#endif #endif

Some files were not shown because too many files have changed in this diff Show More