summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-08 14:28:55 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-08 14:28:55 -0600
commitea13b6e3d0dc0770d4c493ee7a6d1d9f9b884a45 (patch)
tree03e459590b0f781d06f0f23fa6d84c1c31433a82
parentfe77b16ab68a41379e4d9f84e5a29d6bd9fd1323 (diff)
downloadpx4-nuttx-ea13b6e3d0dc0770d4c493ee7a6d1d9f9b884a45.tar.gz
px4-nuttx-ea13b6e3d0dc0770d4c493ee7a6d1d9f9b884a45.tar.bz2
px4-nuttx-ea13b6e3d0dc0770d4c493ee7a6d1d9f9b884a45.zip
All NSH-related files under nuttx/configs changed to use the corrected syslog interfaces
-rw-r--r--nuttx/configs/arduino-due/src/sam_nsh.c23
-rw-r--r--nuttx/configs/cloudctrl/src/up_nsh.c24
-rw-r--r--nuttx/configs/demo9s12ne64/src/up_nsh.c18
-rw-r--r--nuttx/configs/ea3131/src/up_nsh.c37
-rw-r--r--nuttx/configs/ea3152/src/up_nsh.c37
-rw-r--r--nuttx/configs/eagle100/src/up_nsh.c42
-rw-r--r--nuttx/configs/ekk-lm3s9b96/src/up_nsh.c20
-rw-r--r--nuttx/configs/fire-stm32v2/src/up_nsh.c26
-rw-r--r--nuttx/configs/freedom-kl25z/src/kl_nsh.c18
-rw-r--r--nuttx/configs/hymini-stm32v/src/up_nsh.c39
-rw-r--r--nuttx/configs/kwikstik-k40/src/up_nsh.c35
-rw-r--r--nuttx/configs/lincoln60/src/up_nsh.c19
-rw-r--r--nuttx/configs/lm3s6432-s2e/src/up_nsh.c20
-rw-r--r--nuttx/configs/lm3s6965-ek/src/up_nsh.c42
-rw-r--r--nuttx/configs/lm3s8962-ek/src/up_nsh.c42
-rw-r--r--nuttx/configs/lm4f120-launchpad/src/lm4f_nsh.c18
-rw-r--r--nuttx/configs/lpc4330-xplorer/src/up_nsh.c2
-rw-r--r--nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c34
-rw-r--r--nuttx/configs/mbed/src/up_nsh.c18
-rw-r--r--nuttx/configs/mcu123-lpc214x/src/up_nsh.c42
-rw-r--r--nuttx/configs/mikroe-stm32f4/src/up_nsh.c48
-rw-r--r--nuttx/configs/mirtoo/src/up_nsh.c2
-rw-r--r--nuttx/configs/ne64badge/src/up_nsh.c18
-rw-r--r--nuttx/configs/nucleo-f401re/src/stm32_nsh.c29
-rw-r--r--nuttx/configs/nucleus2g/src/up_nsh.c34
-rw-r--r--nuttx/configs/olimex-lpc-h3131/src/lpc31_nsh.c32
-rw-r--r--nuttx/configs/olimex-lpc1766stk/src/lpc17_nsh.c51
-rw-r--r--nuttx/configs/olimex-lpc2378/src/lpc2378_nsh.c18
-rw-r--r--nuttx/configs/olimex-stm32-h405/src/stm32_nsh.c24
-rw-r--r--nuttx/configs/olimex-stm32-p207/src/up_nsh.c26
-rw-r--r--nuttx/configs/olimex-strp711/src/up_nsh.c42
-rw-r--r--nuttx/configs/open1788/src/lpc17_nsh.c42
-rw-r--r--nuttx/configs/pcblogic-pic32mx/src/pic32mx_nsh.c18
-rw-r--r--nuttx/configs/pic32-starterkit/src/up_nsh.c54
-rw-r--r--nuttx/configs/pic32mx7mmb/src/up_nsh.c56
-rw-r--r--nuttx/configs/sam3u-ek/src/up_nsh.c37
-rw-r--r--nuttx/configs/sam4e-ek/src/sam_nsh.c24
-rw-r--r--nuttx/configs/sam4l-xplained/src/sam_nsh.c26
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c50
-rw-r--r--nuttx/configs/sama5d3-xplained/src/sam_nsh.c34
-rw-r--r--nuttx/configs/sama5d3x-ek/src/sam_nsh.c39
-rw-r--r--nuttx/configs/samd20-xplained/src/sam_nsh.c22
-rw-r--r--nuttx/configs/shenzhou/src/up_nsh.c24
-rw-r--r--nuttx/configs/spark/src/up_nsh.c43
-rw-r--r--nuttx/configs/stm3210e-eval/src/up_nsh.c50
-rw-r--r--nuttx/configs/stm3220g-eval/src/up_nsh.c32
-rw-r--r--nuttx/configs/stm3240g-eval/src/up_nsh.c30
-rw-r--r--nuttx/configs/stm32_tiny/src/up_nsh.c20
-rw-r--r--nuttx/configs/stm32f3discovery/src/up_nsh.c20
-rw-r--r--nuttx/configs/stm32f429i-disco/src/stm32_nsh.c38
-rw-r--r--nuttx/configs/stm32ldiscovery/src/stm32_nsh.c20
-rw-r--r--nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c55
-rw-r--r--nuttx/configs/tm4c123g-launchpad/src/tm4c_nsh.c18
-rw-r--r--nuttx/configs/twr-k60n512/src/up_nsh.c35
-rw-r--r--nuttx/configs/ubw32/src/up_nsh.c18
-rw-r--r--nuttx/configs/viewtool-stm32f107/src/stm32_nsh.c17
-rw-r--r--nuttx/configs/zkit-arm-1769/src/up_nsh.c2
-rw-r--r--nuttx/include/syslog.h17
58 files changed, 447 insertions, 1274 deletions
diff --git a/nuttx/configs/arduino-due/src/sam_nsh.c b/nuttx/configs/arduino-due/src/sam_nsh.c
index 283bfde76..e6ef08aa3 100644
--- a/nuttx/configs/arduino-due/src/sam_nsh.c
+++ b/nuttx/configs/arduino-due/src/sam_nsh.c
@@ -40,7 +40,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include "arduino-due.h"
@@ -66,22 +66,6 @@
# 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
****************************************************************************/
@@ -104,8 +88,9 @@ int nsh_archinitialize(void)
int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n",
- ret);
+ syslog(LOG_ERR,
+ "nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n",
+ ret);
return ret;
}
}
diff --git a/nuttx/configs/cloudctrl/src/up_nsh.c b/nuttx/configs/cloudctrl/src/up_nsh.c
index a43b98d47..9754b60f8 100644
--- a/nuttx/configs/cloudctrl/src/up_nsh.c
+++ b/nuttx/configs/cloudctrl/src/up_nsh.c
@@ -43,7 +43,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "stm32.h"
@@ -97,22 +97,6 @@
# undef HAVE_USBHOST
#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
****************************************************************************/
@@ -137,8 +121,8 @@ int nsh_archinitialize(void)
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n",
- CONFIG_NSH_W25MINOR, ret);
+ syslog(LOG_ERR, "ERROR: Failed to initialize W25 minor %d: %d\n",
+ CONFIG_NSH_W25MINOR, ret);
return ret;
}
#endif
@@ -151,7 +135,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
#endif
diff --git a/nuttx/configs/demo9s12ne64/src/up_nsh.c b/nuttx/configs/demo9s12ne64/src/up_nsh.c
index c4773c0ac..dae0a848f 100644
--- a/nuttx/configs/demo9s12ne64/src/up_nsh.c
+++ b/nuttx/configs/demo9s12ne64/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "demo9s12ne64.h"
@@ -50,22 +50,6 @@
* 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
****************************************************************************/
diff --git a/nuttx/configs/ea3131/src/up_nsh.c b/nuttx/configs/ea3131/src/up_nsh.c
index 67d2c4a14..41bdfccb9 100644
--- a/nuttx/configs/ea3131/src/up_nsh.c
+++ b/nuttx/configs/ea3131/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_LPC31_MCI
@@ -96,22 +96,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -132,27 +116,30 @@ int nsh_archinitialize(void)
/* First, get an instance of the SDIO interface */
- message("nsh_archinitialize: Initializing SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
+
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SPI interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
+
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
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;
}
- 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
* see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in
diff --git a/nuttx/configs/ea3152/src/up_nsh.c b/nuttx/configs/ea3152/src/up_nsh.c
index 5c94c053c..8e0815860 100644
--- a/nuttx/configs/ea3152/src/up_nsh.c
+++ b/nuttx/configs/ea3152/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_LPC31_MCI
@@ -96,22 +96,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -132,27 +116,30 @@ int nsh_archinitialize(void)
/* First, get an instance of the SDIO interface */
- message("nsh_archinitialize: Initializing SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
+
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SPI interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
+
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
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;
}
- 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
* see if the LPC313X10E-EVAL board supports a GPIO to detect if there is a card in
diff --git a/nuttx/configs/eagle100/src/up_nsh.c b/nuttx/configs/eagle100/src/up_nsh.c
index 4b8163182..0d9cda1be 100644
--- a/nuttx/configs/eagle100/src/up_nsh.c
+++ b/nuttx/configs/eagle100/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Initializing SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("nsh_archinitialize: Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */
- message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK;
}
diff --git a/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c b/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c
index f54fb726c..611261a61 100644
--- a/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c
+++ b/nuttx/configs/ekk-lm3s9b96/src/up_nsh.c
@@ -42,31 +42,13 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
/****************************************************************************
* 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
****************************************************************************/
diff --git a/nuttx/configs/fire-stm32v2/src/up_nsh.c b/nuttx/configs/fire-stm32v2/src/up_nsh.c
index 7c0b3dc38..7d10445a1 100644
--- a/nuttx/configs/fire-stm32v2/src/up_nsh.c
+++ b/nuttx/configs/fire-stm32v2/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "stm32.h"
@@ -123,22 +123,6 @@
# undef HAVE_USBDEV
#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
****************************************************************************/
@@ -163,8 +147,8 @@ int nsh_archinitialize(void)
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize W25 minor %d: %d\n",
- CONFIG_NSH_W25MINOR, ret);
+ syslog(LOG_ERR, "ERROR: Failed to initialize W25 minor %d: %d\n",
+ CONFIG_NSH_W25MINOR, ret);
return ret;
}
#endif
@@ -175,8 +159,8 @@ int nsh_archinitialize(void)
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
#endif
diff --git a/nuttx/configs/freedom-kl25z/src/kl_nsh.c b/nuttx/configs/freedom-kl25z/src/kl_nsh.c
index 3b9187466..c5476f55c 100644
--- a/nuttx/configs/freedom-kl25z/src/kl_nsh.c
+++ b/nuttx/configs/freedom-kl25z/src/kl_nsh.c
@@ -41,29 +41,13 @@
#include <sys/types.h>
#include <stdio.h>
+#include <syslog.h>
#ifdef CONFIG_NSH_LIBRARY
/****************************************************************************
* 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
diff --git a/nuttx/configs/hymini-stm32v/src/up_nsh.c b/nuttx/configs/hymini-stm32v/src/up_nsh.c
index 680271dc2..7c29bc2c0 100644
--- a/nuttx/configs/hymini-stm32v/src/up_nsh.c
+++ b/nuttx/configs/hymini-stm32v/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_STM32_SPI1
@@ -68,7 +68,6 @@
#undef CONFIG_STM32_SPI1
-
/* Check if we can have USB device in NSH */
#define NSH_HAVEUSBDEV 1
@@ -104,23 +103,6 @@
# 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
****************************************************************************/
@@ -190,27 +172,30 @@ int nsh_archinitialize(void)
/* First, get an instance of the SDIO interface */
- message("nsh_archinitialize: Initializing SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
+
g_sdiodev = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_sdiodev)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SDIO interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
+
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdiodev);
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;
}
- 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 */
diff --git a/nuttx/configs/kwikstik-k40/src/up_nsh.c b/nuttx/configs/kwikstik-k40/src/up_nsh.c
index 1e52c931e..42885d12f 100644
--- a/nuttx/configs/kwikstik-k40/src/up_nsh.c
+++ b/nuttx/configs/kwikstik-k40/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_KINETIS_SDHC
@@ -105,22 +105,6 @@
# error "CONFIG_KINETIS_PORTEINTS required for card detect interrupt"
#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
****************************************************************************/
@@ -222,29 +206,30 @@ int nsh_archinitialize(void)
/* Mount the SDHC-based MMC/SD block driver */
/* First, get an instance of the SDHC interface */
- message("nsh_archinitialize: Initializing SDHC slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDHC slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
g_nsh.sdhc = sdhc_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_nsh.sdhc)
{
- message("nsh_archinitialize: Failed to initialize SDHC slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDHC slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SDHC interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDHC to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDHC to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc);
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;
}
- 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 */
diff --git a/nuttx/configs/lincoln60/src/up_nsh.c b/nuttx/configs/lincoln60/src/up_nsh.c
index 0dda48bb2..d54c140c3 100644
--- a/nuttx/configs/lincoln60/src/up_nsh.c
+++ b/nuttx/configs/lincoln60/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -50,23 +50,6 @@
/****************************************************************************
* 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
diff --git a/nuttx/configs/lm3s6432-s2e/src/up_nsh.c b/nuttx/configs/lm3s6432-s2e/src/up_nsh.c
index a480ade46..009849bc7 100644
--- a/nuttx/configs/lm3s6432-s2e/src/up_nsh.c
+++ b/nuttx/configs/lm3s6432-s2e/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -51,24 +51,6 @@
* 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
****************************************************************************/
diff --git a/nuttx/configs/lm3s6965-ek/src/up_nsh.c b/nuttx/configs/lm3s6965-ek/src/up_nsh.c
index 92a19e500..65770f0a9 100644
--- a/nuttx/configs/lm3s6965-ek/src/up_nsh.c
+++ b/nuttx/configs/lm3s6965-ek/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Initializing SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("nsh_archinitialize: Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */
- message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK;
}
diff --git a/nuttx/configs/lm3s8962-ek/src/up_nsh.c b/nuttx/configs/lm3s8962-ek/src/up_nsh.c
index 13985a25c..9063dee4d 100644
--- a/nuttx/configs/lm3s8962-ek/src/up_nsh.c
+++ b/nuttx/configs/lm3s8962-ek/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Initializing SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("nsh_archinitialize: Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */
- message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK;
}
diff --git a/nuttx/configs/lm4f120-launchpad/src/lm4f_nsh.c b/nuttx/configs/lm4f120-launchpad/src/lm4f_nsh.c
index 22a9103d8..f3eed743b 100644
--- a/nuttx/configs/lm4f120-launchpad/src/lm4f_nsh.c
+++ b/nuttx/configs/lm4f120-launchpad/src/lm4f_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -68,22 +68,6 @@
# undef NSH_HAVEUSBDEV
#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
****************************************************************************/
diff --git a/nuttx/configs/lpc4330-xplorer/src/up_nsh.c b/nuttx/configs/lpc4330-xplorer/src/up_nsh.c
index df1f0ddf7..732c4f8f1 100644
--- a/nuttx/configs/lpc4330-xplorer/src/up_nsh.c
+++ b/nuttx/configs/lpc4330-xplorer/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "chip.h"
diff --git a/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c b/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c
index 47c4dc0bb..93cb3c0b2 100644
--- a/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c
+++ b/nuttx/configs/lpcxpresso-lpc1768/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -99,22 +99,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -146,26 +130,26 @@ int nsh_archinitialize(void)
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
- message("nsh_archinitialize: Failed to initialize SSP port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SSP port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("Successfully initialized SSP port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SSP port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("Successfuly bound SSP port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
#endif
return OK;
}
diff --git a/nuttx/configs/mbed/src/up_nsh.c b/nuttx/configs/mbed/src/up_nsh.c
index ab865033a..4d7ac8b4e 100644
--- a/nuttx/configs/mbed/src/up_nsh.c
+++ b/nuttx/configs/mbed/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -68,22 +68,6 @@
# undef NSH_HAVEUSBDEV
#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
****************************************************************************/
diff --git a/nuttx/configs/mcu123-lpc214x/src/up_nsh.c b/nuttx/configs/mcu123-lpc214x/src/up_nsh.c
index 989dc2952..2496f38d7 100644
--- a/nuttx/configs/mcu123-lpc214x/src/up_nsh.c
+++ b/nuttx/configs/mcu123-lpc214x/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -91,22 +91,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -126,34 +110,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Initializing SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("nsh_archinitialize: Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */
- message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK;
}
diff --git a/nuttx/configs/mikroe-stm32f4/src/up_nsh.c b/nuttx/configs/mikroe-stm32f4/src/up_nsh.c
index 31e9be21d..b68101c0a 100644
--- a/nuttx/configs/mikroe-stm32f4/src/up_nsh.c
+++ b/nuttx/configs/mikroe-stm32f4/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/kmalloc.h>
@@ -147,22 +147,6 @@
# 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
****************************************************************************/
@@ -192,28 +176,29 @@ int nsh_archinitialize(void)
#ifdef CONFIG_STM32_SPI3
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port 3\n");
+ syslog(LOG_INFO, "Initializing SPI port 3\n");
spi = up_spiinitialize(3);
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;
}
- 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 */
#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);
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
{
- 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
{
@@ -317,16 +302,17 @@ int nsh_archinitialize(void)
#ifdef NSH_HAVEMMCSD
/* Bind the spi interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
+
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
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
{
- 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
@@ -338,7 +324,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
#endif
@@ -349,19 +335,19 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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
#if defined(CONFIG_LCD_MIO283QT2) || defined(CONFIG_LCD_MIO283QT9A)
/* Configure the TFT LCD module */
- message("nsh_archinitialize: Initializing TFT LCD module\n");
+ syslog(LOG_INFO, "Initializing TFT LCD module\n");
ret = up_lcdinitialize();
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
diff --git a/nuttx/configs/mirtoo/src/up_nsh.c b/nuttx/configs/mirtoo/src/up_nsh.c
index f81104c2b..9aa1f9aa9 100644
--- a/nuttx/configs/mirtoo/src/up_nsh.c
+++ b/nuttx/configs/mirtoo/src/up_nsh.c
@@ -45,7 +45,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
-#include <debug.h>
+#include <syslog.h>
#ifdef CONFIG_PIC32MX_SPI2
# include <nuttx/spi/spi.h>
diff --git a/nuttx/configs/ne64badge/src/up_nsh.c b/nuttx/configs/ne64badge/src/up_nsh.c
index 10e0e74d5..b0cbbd635 100644
--- a/nuttx/configs/ne64badge/src/up_nsh.c
+++ b/nuttx/configs/ne64badge/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "ne64badge_internal.h"
@@ -50,22 +50,6 @@
* 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
****************************************************************************/
diff --git a/nuttx/configs/nucleo-f401re/src/stm32_nsh.c b/nuttx/configs/nucleo-f401re/src/stm32_nsh.c
index 3074d57c1..43aef2c59 100644
--- a/nuttx/configs/nucleo-f401re/src/stm32_nsh.c
+++ b/nuttx/configs/nucleo-f401re/src/stm32_nsh.c
@@ -40,7 +40,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/arch.h>
@@ -57,23 +57,6 @@
/****************************************************************************
* 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
@@ -127,8 +110,8 @@ int nsh_archinitialize(void)
g_sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_sdio)
{
- message("[boot] Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
@@ -137,7 +120,9 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdio);
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;
}
@@ -147,7 +132,7 @@ int nsh_archinitialize(void)
sdio_mediachange(g_sdio, true);
- message("[boot] Initialized SDIO\n");
+ syslog(LOG_INFO, "[boot] Initialized SDIO\n");
#endif
return OK;
diff --git a/nuttx/configs/nucleus2g/src/up_nsh.c b/nuttx/configs/nucleus2g/src/up_nsh.c
index 8dbdf9134..7bfc89d3e 100644
--- a/nuttx/configs/nucleus2g/src/up_nsh.c
+++ b/nuttx/configs/nucleus2g/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -93,22 +93,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -139,26 +123,26 @@ int nsh_archinitialize(void)
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
- message("nsh_archinitialize: Failed to initialize SSP port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SSP port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("Successfully initialized SSP port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SSP port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("Successfuly bound SSP port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
return OK;
}
diff --git a/nuttx/configs/olimex-lpc-h3131/src/lpc31_nsh.c b/nuttx/configs/olimex-lpc-h3131/src/lpc31_nsh.c
index bb72ee88b..f800a1220 100644
--- a/nuttx/configs/olimex-lpc-h3131/src/lpc31_nsh.c
+++ b/nuttx/configs/olimex-lpc-h3131/src/lpc31_nsh.c
@@ -41,7 +41,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
@@ -69,22 +69,6 @@
# 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
****************************************************************************/
@@ -106,12 +90,12 @@ int nsh_archinitialize(void)
#ifdef HAVE_MMCSD
/* 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);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO, CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO, CONFIG_NSH_MMCSDMINOR);
return -ENODEV;
}
#endif
@@ -121,11 +105,11 @@ int nsh_archinitialize(void)
* 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();
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;
}
#endif
@@ -133,11 +117,11 @@ int nsh_archinitialize(void)
#ifdef HAVE_USBMONITOR
/* 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);
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
diff --git a/nuttx/configs/olimex-lpc1766stk/src/lpc17_nsh.c b/nuttx/configs/olimex-lpc1766stk/src/lpc17_nsh.c
index 204ac7f4b..c72817fd8 100644
--- a/nuttx/configs/olimex-lpc1766stk/src/lpc17_nsh.c
+++ b/nuttx/configs/olimex-lpc1766stk/src/lpc17_nsh.c
@@ -41,7 +41,7 @@
#include <stdio.h>
#include <unistd.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -117,22 +117,6 @@
# 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
****************************************************************************/
@@ -158,7 +142,7 @@ static int nsh_waiter(int argc, char *argv[])
{
bool connected = false;
- message("nsh_waiter: Running\n");
+ syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;)
{
/* 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));
connected = !connected;
- message("nsh_waiter: %s\n", connected ? "connected" : "disconnected");
+ syslog(LOG_INFO, "%s\n", connected ? "connected" : "disconnected");
/* Did we just become connected? */
@@ -207,14 +191,14 @@ static int nsh_sdinitialize(void)
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
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);
ret = -ENODEV;
goto errout;
}
- message("Successfully initialized SSP port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SSP port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SSP port to the slot */
@@ -222,16 +206,16 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0)
{
- message("nsh_sdinitialize: "
- "Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR,
+ "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout;
}
- message("Successfuly bound SSP port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfully bound SSP port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO);
return OK;
/* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */
@@ -262,28 +246,29 @@ static int nsh_usbhostinitialize(void)
* that we care about:
*/
- message("nsh_usbhostinitialize: Register class drivers\n");
+ syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit();
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 */
- message("nsh_usbhostinitialize: Initialize USB host\n");
+ syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = lpc17_usbhost_initialize(0);
if (g_usbconn)
{
/* 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,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
}
+
return -ENODEV;
}
#else
diff --git a/nuttx/configs/olimex-lpc2378/src/lpc2378_nsh.c b/nuttx/configs/olimex-lpc2378/src/lpc2378_nsh.c
index 903af225e..4b3ed84ca 100644
--- a/nuttx/configs/olimex-lpc2378/src/lpc2378_nsh.c
+++ b/nuttx/configs/olimex-lpc2378/src/lpc2378_nsh.c
@@ -46,7 +46,7 @@
#include <sys/types.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -79,22 +79,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
diff --git a/nuttx/configs/olimex-stm32-h405/src/stm32_nsh.c b/nuttx/configs/olimex-stm32-h405/src/stm32_nsh.c
index a3c648658..73f7923f1 100644
--- a/nuttx/configs/olimex-stm32-h405/src/stm32_nsh.c
+++ b/nuttx/configs/olimex-stm32-h405/src/stm32_nsh.c
@@ -41,7 +41,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
@@ -59,24 +59,6 @@
* 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
****************************************************************************/
@@ -108,7 +90,7 @@ int nsh_archinitialize(void)
ret = stm32_can_initialize();
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
@@ -118,7 +100,7 @@ int nsh_archinitialize(void)
ret = stm32_adc_initialize();
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
diff --git a/nuttx/configs/olimex-stm32-p207/src/up_nsh.c b/nuttx/configs/olimex-stm32-p207/src/up_nsh.c
index 49f481c15..824ece45b 100644
--- a/nuttx/configs/olimex-stm32-p207/src/up_nsh.c
+++ b/nuttx/configs/olimex-stm32-p207/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
@@ -93,22 +93,6 @@
# undef HAVE_USBMONITOR
#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
****************************************************************************/
@@ -140,7 +124,7 @@ int nsh_archinitialize(void)
ret = stm32_can_initialize();
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
@@ -150,7 +134,7 @@ int nsh_archinitialize(void)
ret = stm32_adc_initialize();
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
@@ -162,7 +146,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
#endif
@@ -173,7 +157,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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
diff --git a/nuttx/configs/olimex-strp711/src/up_nsh.c b/nuttx/configs/olimex-strp711/src/up_nsh.c
index 693a51d2a..6f7cc7a19 100644
--- a/nuttx/configs/olimex-strp711/src/up_nsh.c
+++ b/nuttx/configs/olimex-strp711/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -95,22 +95,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -131,35 +115,35 @@ int nsh_archinitialize(void)
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Initializing SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
return -ENODEV;
}
- message("nsh_archinitialize: Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */
- message("nsh_archinitialize: Binding SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret;
}
- message("nsh_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
#endif
return OK;
diff --git a/nuttx/configs/open1788/src/lpc17_nsh.c b/nuttx/configs/open1788/src/lpc17_nsh.c
index 56f01ce3d..9cb7570c9 100644
--- a/nuttx/configs/open1788/src/lpc17_nsh.c
+++ b/nuttx/configs/open1788/src/lpc17_nsh.c
@@ -42,7 +42,7 @@
#include <stdio.h>
#include <unistd.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/arch.h>
@@ -143,22 +143,6 @@
# undef NSH_HAVE_USBDEV
#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
****************************************************************************/
@@ -188,7 +172,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false;
int ret;
- message("nsh_waiter: Running\n");
+ syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;)
{
/* Wait for the device to change state */
@@ -197,7 +181,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK);
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? */
@@ -275,8 +260,8 @@ static int nsh_sdinitialize(void)
g_sdiodev = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_sdiodev)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
@@ -285,10 +270,9 @@ static int nsh_sdinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdiodev);
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;
}
@@ -326,22 +310,22 @@ static int nsh_usbhostinitialize(void)
* that we care about:
*/
- message("nsh_usbhostinitialize: Register class drivers\n");
+ syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit();
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 */
- message("nsh_usbhostinitialize: Initialize USB host\n");
+ syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = lpc17_usbhost_initialize(0);
if (g_usbconn)
{
/* 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,
CONFIG_USBHOST_STACKSIZE,
diff --git a/nuttx/configs/pcblogic-pic32mx/src/pic32mx_nsh.c b/nuttx/configs/pcblogic-pic32mx/src/pic32mx_nsh.c
index 8154125f8..e30001ef3 100644
--- a/nuttx/configs/pcblogic-pic32mx/src/pic32mx_nsh.c
+++ b/nuttx/configs/pcblogic-pic32mx/src/pic32mx_nsh.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#include <debug.h>
+#include <syslog.h>
#include <nuttx/lcd/hd4478ou.h>
#include <arch/board/board.h>
@@ -56,22 +56,6 @@
# define OK 0
#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
****************************************************************************/
diff --git a/nuttx/configs/pic32-starterkit/src/up_nsh.c b/nuttx/configs/pic32-starterkit/src/up_nsh.c
index 6500e0a41..2a03da2a2 100644
--- a/nuttx/configs/pic32-starterkit/src/up_nsh.c
+++ b/nuttx/configs/pic32-starterkit/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdio.h>
#include <unistd.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -150,22 +150,6 @@
# 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
****************************************************************************/
@@ -192,7 +176,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false;
int ret;
- message("nsh_waiter: Running\n");
+ syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;)
{
/* Wait for the device to change state */
@@ -201,7 +185,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK);
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? */
@@ -238,14 +223,14 @@ static int nsh_sdinitialize(void)
ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
ret = -ENODEV;
goto errout;
}
- message("Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* Bind the SPI port to the slot */
@@ -253,16 +238,16 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, ssp);
if (ret < 0)
{
- message("nsh_sdinitialize: "
- "Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR,
+ "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout;
}
- message("Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfuly bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO);
return OK;
errout:
@@ -290,28 +275,29 @@ static int nsh_usbhostinitialize(void)
* that we care about:
*/
- message("nsh_usbhostinitialize: Register class drivers\n");
+ syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit();
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 */
- message("nsh_usbhostinitialize: Initialize USB host\n");
+ syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = pic32_usbhost_initialize(0);
if (g_usbconn)
{
/* 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,
CONFIG_USBHOST_STACKSIZE,
(main_t)nsh_waiter, (FAR char * const *)NULL);
return pid < 0 ? -ENOEXEC : OK;
}
+
return -ENODEV;
}
#else
diff --git a/nuttx/configs/pic32mx7mmb/src/up_nsh.c b/nuttx/configs/pic32mx7mmb/src/up_nsh.c
index 77bfedaaf..c6e1ec550 100644
--- a/nuttx/configs/pic32mx7mmb/src/up_nsh.c
+++ b/nuttx/configs/pic32mx7mmb/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdio.h>
#include <unistd.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -149,22 +149,6 @@
# 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
****************************************************************************/
@@ -191,7 +175,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false;
int ret;
- message("nsh_waiter: Running\n");
+ syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;)
{
/* Wait for the device to change state */
@@ -200,7 +184,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK);
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? */
@@ -237,14 +222,14 @@ static int nsh_sdinitialize(void)
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
ret = -ENODEV;
goto errout;
}
- message("Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* The SPI should be in 8-bit (default) and mode2: CKP=1, CKE=0.
* The MMC/SD driver will control the SPI frequency. WARNING:
@@ -261,16 +246,18 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_sdinitialize: "
- "Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR,
+ "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout;
}
- message("Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO,
+ "Successfully bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO);
+
return OK;
errout:
@@ -298,22 +285,22 @@ static int nsh_usbhostinitialize(void)
* that we care about:
*/
- message("nsh_usbhostinitialize: Register class drivers\n");
+ syslog(LOG_INFO, "Register class drivers\n");
ret = usbhost_storageinit();
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 */
- message("nsh_usbhostinitialize: Initialize USB host\n");
+ syslog(LOG_INFO, "Initialize USB host\n");
g_usbconn = pic32_usbhost_initialize(0);
if (g_usbconn)
{
/* 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,
CONFIG_USBHOST_STACKSIZE,
@@ -381,5 +368,6 @@ int nsh_archinitialize(void)
ret = nsh_usbdevinitialize();
}
+
return ret;
}
diff --git a/nuttx/configs/sam3u-ek/src/up_nsh.c b/nuttx/configs/sam3u-ek/src/up_nsh.c
index ded7d5527..e20a7e1a9 100644
--- a/nuttx/configs/sam3u-ek/src/up_nsh.c
+++ b/nuttx/configs/sam3u-ek/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/sdio.h>
@@ -96,22 +96,6 @@
# undef NSH_HAVE_USBDEV
#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
****************************************************************************/
@@ -133,27 +117,30 @@ int nsh_archinitialize(void)
/* Mount the SDIO-based MMC/SD block driver */
/* First, get an instance of the SDIO interface */
- message("nsh_archinitialize: Initializing SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
+
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SDIO interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
+
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
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;
}
- 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. */
diff --git a/nuttx/configs/sam4e-ek/src/sam_nsh.c b/nuttx/configs/sam4e-ek/src/sam_nsh.c
index a103ceaab..c567eedf0 100644
--- a/nuttx/configs/sam4e-ek/src/sam_nsh.c
+++ b/nuttx/configs/sam4e-ek/src/sam_nsh.c
@@ -44,7 +44,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
-#include <debug.h>
+#include <syslog.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h>
@@ -56,22 +56,6 @@
* 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
****************************************************************************/
@@ -96,7 +80,7 @@ int nsh_archinitialize(void)
ret = sam_at25_automount(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;
}
#endif
@@ -107,7 +91,7 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(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;
}
#endif
@@ -118,7 +102,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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;
}
#endif
diff --git a/nuttx/configs/sam4l-xplained/src/sam_nsh.c b/nuttx/configs/sam4l-xplained/src/sam_nsh.c
index 2e4a5709f..ac60b39cf 100644
--- a/nuttx/configs/sam4l-xplained/src/sam_nsh.c
+++ b/nuttx/configs/sam4l-xplained/src/sam_nsh.c
@@ -40,7 +40,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include "sam4l-xplained.h"
@@ -69,22 +69,6 @@
# 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
****************************************************************************/
@@ -106,8 +90,8 @@ int nsh_archinitialize(void)
int ret = sam_slcd_initialize();
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize the LCD: %d\n",
- ret);
+ syslog(LOG_ERR, "ERROR: Failed to initialize the LCD: %d\n",
+ ret);
return ret;
}
}
@@ -119,8 +103,8 @@ int nsh_archinitialize(void)
int ret = sam_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n",
- ret);
+ syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n",
+ ret);
return ret;
}
}
diff --git a/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c b/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
index cc7a66c37..7353dd29d 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
+++ b/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
@@ -45,7 +45,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
-#include <debug.h>
+#include <syslog.h>
#include <unistd.h>
#include <nuttx/arch.h>
@@ -72,22 +72,6 @@
* 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
****************************************************************************/
@@ -108,11 +92,14 @@ int nsh_archinitialize(void)
#endif
#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);
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;
}
#endif
@@ -120,11 +107,14 @@ int nsh_archinitialize(void)
#ifdef HAVE_HSMCI
/* Initialize the HSMCI driver */
- message("initializing HSMCI\n");
+ syslog(LOG_INFO, "initializing HSMCI\n");
+
ret = sam_hsmci_initialize();
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;
}
#endif
@@ -132,21 +122,27 @@ int nsh_archinitialize(void)
#ifdef HAVE_PROC
/* 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);
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;
}
#endif
#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);
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;
}
#endif
@@ -154,11 +150,11 @@ int nsh_archinitialize(void)
#ifdef HAVE_USBMONITOR
/* Start the USB Monitor */
- message("Starting USB Monitor\n");
+ syslog(LOG_INFO, "Starting USB Monitor\n");
ret = usbmonitor_start(0, NULL);
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;
}
#endif
diff --git a/nuttx/configs/sama5d3-xplained/src/sam_nsh.c b/nuttx/configs/sama5d3-xplained/src/sam_nsh.c
index 20cb0ae85..842d807ae 100644
--- a/nuttx/configs/sama5d3-xplained/src/sam_nsh.c
+++ b/nuttx/configs/sama5d3-xplained/src/sam_nsh.c
@@ -44,7 +44,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
-#include <debug.h>
+#include <syslog.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h>
@@ -56,22 +56,6 @@
* 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
****************************************************************************/
@@ -97,7 +81,7 @@ int nsh_archinitialize(void)
ret = sam_nand_automount(NAND_MINOR);
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;
}
#endif
@@ -108,7 +92,7 @@ int nsh_archinitialize(void)
ret = sam_at25_automount(AT25_MINOR);
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;
}
#endif
@@ -120,8 +104,8 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
if (ret < 0)
{
- message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
- HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
+ syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
+ HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
return ret;
}
#endif
@@ -132,8 +116,8 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR);
if (ret < 0)
{
- message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
- HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
+ syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
+ HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
return ret;
}
#endif
@@ -147,7 +131,7 @@ int nsh_archinitialize(void)
ret = sam_usbhost_initialize();
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;
}
#endif
@@ -158,7 +142,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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
diff --git a/nuttx/configs/sama5d3x-ek/src/sam_nsh.c b/nuttx/configs/sama5d3x-ek/src/sam_nsh.c
index e057c5144..deaaf53d1 100644
--- a/nuttx/configs/sama5d3x-ek/src/sam_nsh.c
+++ b/nuttx/configs/sama5d3x-ek/src/sam_nsh.c
@@ -44,7 +44,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
-#include <debug.h>
+#include <syslog.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h>
@@ -56,22 +56,6 @@
* 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
****************************************************************************/
@@ -98,7 +82,7 @@ int nsh_archinitialize(void)
ret = sam_nand_automount(NAND_MINOR);
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;
}
#endif
@@ -109,7 +93,7 @@ int nsh_archinitialize(void)
ret = sam_at25_automount(AT25_MINOR);
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;
}
#endif
@@ -120,7 +104,7 @@ int nsh_archinitialize(void)
ret = sam_at24_automount(AT24_MINOR);
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;
}
#endif
@@ -132,8 +116,8 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
if (ret < 0)
{
- message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
- HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
+ syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
+ HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
return ret;
}
#endif
@@ -144,8 +128,8 @@ int nsh_archinitialize(void)
ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR);
if (ret < 0)
{
- message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
- HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
+ syslog(LOG_ERR, "ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
+ HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
return ret;
}
#endif
@@ -159,7 +143,7 @@ int nsh_archinitialize(void)
ret = sam_usbhost_initialize();
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;
}
#endif
@@ -170,7 +154,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
if (ret != OK)
{
- message("nsh_archinitialize: Start USB monitor: %d\n", ret);
+ syslog(LOG_ERR, "ERROR: Start USB monitor: %d\n", ret);
}
#endif
@@ -180,7 +164,8 @@ int nsh_archinitialize(void)
ret = sam_wm8904_initialize(0);
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
diff --git a/nuttx/configs/samd20-xplained/src/sam_nsh.c b/nuttx/configs/samd20-xplained/src/sam_nsh.c
index e781b51b7..e2b69b53d 100644
--- a/nuttx/configs/samd20-xplained/src/sam_nsh.c
+++ b/nuttx/configs/samd20-xplained/src/sam_nsh.c
@@ -40,7 +40,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include "sam_config.h"
#include "samd20-xplained.h"
@@ -91,22 +91,6 @@
# 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
****************************************************************************/
@@ -128,8 +112,8 @@ int nsh_archinitialize(void)
int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR);
if (ret < 0)
{
- message("nsh_archinitialize: Failed to initialize MMC/SD slot: %d\n",
- ret);
+ syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n",
+ ret);
return ret;
}
}
diff --git a/nuttx/configs/shenzhou/src/up_nsh.c b/nuttx/configs/shenzhou/src/up_nsh.c
index 0b9802581..2e8726f51 100644
--- a/nuttx/configs/shenzhou/src/up_nsh.c
+++ b/nuttx/configs/shenzhou/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "stm32.h"
@@ -145,22 +145,6 @@
# undef HAVE_USBHOST
#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
****************************************************************************/
@@ -185,7 +169,7 @@ int nsh_archinitialize(void)
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
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);
return ret;
}
@@ -197,7 +181,7 @@ int nsh_archinitialize(void)
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
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);
return ret;
}
@@ -211,7 +195,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
#endif
diff --git a/nuttx/configs/spark/src/up_nsh.c b/nuttx/configs/spark/src/up_nsh.c
index 45bd8f5e4..9992347b1 100644
--- a/nuttx/configs/spark/src/up_nsh.c
+++ b/nuttx/configs/spark/src/up_nsh.c
@@ -43,7 +43,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/kmalloc.h>
@@ -116,22 +116,6 @@
# undef HAVE_USBMONITOR
#endif
-/* Debug ********************************************************************/
-
-#ifdef CONFIG_CPP_HAVE_VARARGS
-# ifdef CONFIG_DEBUG
-# define message(...) lowsyslog(__VA_ARGS__)
-# else
-# define message(...) printf(__VA_ARGS__)
-# endif
-#else
-# ifdef CONFIG_DEBUG
-# define message lowsyslog
-# else
-# define message printf
-# endif
-#endif
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -159,33 +143,34 @@ int nsh_archinitialize(void)
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
+ syslog(LOG_INFO, "Initializing SPI port %d\n",
+ CONFIG_SPARK_FLASH_SPI);
spi = up_spiinitialize(CONFIG_SPARK_FLASH_SPI);
if (!spi)
{
- message("nsh_archinitialize: ERROR: Failed to initialize SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_SPARK_FLASH_SPI);
return -ENODEV;
}
- message("nsh_archinitialize: Successfully initialized SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_SPARK_FLASH_SPI);
/* Now bind the SPI interface to the SST25 SPI FLASH driver */
- message("nsh_archinitialize: Bind SPI to the SPI flash driver\n");
+ syslog(LOG_INFO, "Bind SPI to the SPI flash driver\n");
+
mtd = sst25_initialize(spi);
if (!mtd)
{
- message("nsh_archinitialize: Failed to bind SPI port %d to the SPI FLASH driver\n",
- CONFIG_SPARK_FLASH_SPI);
+ syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n",
+ CONFIG_SPARK_FLASH_SPI);
}
else
{
- message("nsh_archinitialize: Successfully bound SPI port %d to the SPI FLASH driver\n",
- CONFIG_SPARK_FLASH_SPI);
+ syslog(LOG_INFO, "Successfully bound SPI port %d to the SPI FLASH driver\n",
+ CONFIG_SPARK_FLASH_SPI);
}
#ifndef CONFIG_SPARK_FLASH_PART
@@ -293,7 +278,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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
diff --git a/nuttx/configs/stm3210e-eval/src/up_nsh.c b/nuttx/configs/stm3210e-eval/src/up_nsh.c
index 58e7e6214..3431676cb 100644
--- a/nuttx/configs/stm3210e-eval/src/up_nsh.c
+++ b/nuttx/configs/stm3210e-eval/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_STM32_SPI1
@@ -104,22 +104,6 @@
# define CONFIG_NSH_MMCSDMINOR 0
#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
****************************************************************************/
@@ -148,25 +132,27 @@ int nsh_archinitialize(void)
#ifdef CONFIG_STM32_SPI1
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port 1\n");
+ syslog(LOG_INFO, "Initializing SPI port 1\n");
spi = up_spiinitialize(1);
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;
}
- 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 */
- 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);
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;
}
- 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?"
#endif
@@ -180,27 +166,29 @@ int nsh_archinitialize(void)
#ifdef NSH_HAVEMMCSD
/* First, get an instance of the SDIO interface */
- message("nsh_archinitialize: Initializing SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
+
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SDIO interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDIO to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
+
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
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;
}
- 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
* see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in
diff --git a/nuttx/configs/stm3220g-eval/src/up_nsh.c b/nuttx/configs/stm3220g-eval/src/up_nsh.c
index c0f74edbd..5a4e588e2 100644
--- a/nuttx/configs/stm3220g-eval/src/up_nsh.c
+++ b/nuttx/configs/stm3220g-eval/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_STM32_SPI1
@@ -118,22 +118,6 @@
# undef HAVE_USBHOST
#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
****************************************************************************/
@@ -167,7 +151,7 @@ int nsh_archinitialize(void)
spi = up_spiinitialize(1);
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;
}
@@ -176,7 +160,7 @@ int nsh_archinitialize(void)
mtd = m25p_initialize(spi);
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;
}
@@ -188,13 +172,11 @@ int nsh_archinitialize(void)
#ifdef HAVE_MMCSD
/* 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);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
@@ -203,7 +185,7 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
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;
}
@@ -223,7 +205,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
#endif
diff --git a/nuttx/configs/stm3240g-eval/src/up_nsh.c b/nuttx/configs/stm3240g-eval/src/up_nsh.c
index 6d297fcf6..982e5fbab 100644
--- a/nuttx/configs/stm3240g-eval/src/up_nsh.c
+++ b/nuttx/configs/stm3240g-eval/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_STM32_SPI1
@@ -124,22 +124,6 @@
# undef HAVE_USBHOST
#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
****************************************************************************/
@@ -173,7 +157,7 @@ int nsh_archinitialize(void)
spi = up_spiinitialize(1);
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;
}
@@ -182,7 +166,7 @@ int nsh_archinitialize(void)
mtd = m25p_initialize(spi);
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;
}
#warning "Now what are we going to do with this SPI FLASH driver?"
@@ -196,8 +180,8 @@ int nsh_archinitialize(void)
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio)
{
- message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
@@ -206,7 +190,7 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
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;
}
@@ -226,7 +210,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
#endif
diff --git a/nuttx/configs/stm32_tiny/src/up_nsh.c b/nuttx/configs/stm32_tiny/src/up_nsh.c
index cbef9ac41..1ceb3b56c 100644
--- a/nuttx/configs/stm32_tiny/src/up_nsh.c
+++ b/nuttx/configs/stm32_tiny/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include "stm32.h"
@@ -51,22 +51,6 @@
* 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
****************************************************************************/
@@ -82,7 +66,7 @@
int nsh_archinitialize(void)
{
#if defined(CONFIG_WL_NRF24L01)
- message("Register the nRF24L01 module");
+ syslog(LOG_INFO, "Register the nRF24L01 module");
up_wlinitialize();
#endif
diff --git a/nuttx/configs/stm32f3discovery/src/up_nsh.c b/nuttx/configs/stm32f3discovery/src/up_nsh.c
index 08737a320..113a1f704 100644
--- a/nuttx/configs/stm32f3discovery/src/up_nsh.c
+++ b/nuttx/configs/stm32f3discovery/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_SYSTEM_USBMONITOR
@@ -83,22 +83,6 @@
# undef HAVE_USBMONITOR
#endif
-/* Debug ********************************************************************/
-
-#ifdef CONFIG_CPP_HAVE_VARARGS
-# ifdef CONFIG_DEBUG
-# define message(...) lowsyslog(__VA_ARGS__)
-# else
-# define message(...) printf(__VA_ARGS__)
-# endif
-#else
-# ifdef CONFIG_DEBUG
-# define message lowsyslog
-# else
-# define message printf
-# endif
-#endif
-
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -121,7 +105,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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
diff --git a/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c b/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c
index c949ececa..2f22a0748 100644
--- a/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c
+++ b/nuttx/configs/stm32f429i-disco/src/stm32_nsh.c
@@ -41,7 +41,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/kmalloc.h>
@@ -112,22 +112,6 @@
# undef HAVE_USBMONITOR
#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
****************************************************************************/
@@ -165,15 +149,16 @@ int nsh_archinitialize(void)
#ifdef CONFIG_STM32_SPI4
/* Get the SPI port */
- message("nsh_archinitialize: Initializing SPI port 4\n");
+ syslog(LOG_INFO, "Initializing SPI port 4\n");
+
spi = up_spiinitialize(4);
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;
}
- 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
* 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)
- 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);
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
{
- 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
{
@@ -314,7 +300,7 @@ int nsh_archinitialize(void)
ret = stm32_usbhost_initialize();
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;
}
@@ -324,7 +310,7 @@ int nsh_archinitialize(void)
ret = usbhost_storageinit();
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;
}
@@ -338,7 +324,7 @@ int nsh_archinitialize(void)
ret = usbmonitor_start(0, NULL);
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
diff --git a/nuttx/configs/stm32ldiscovery/src/stm32_nsh.c b/nuttx/configs/stm32ldiscovery/src/stm32_nsh.c
index bd633b659..b3bc54095 100644
--- a/nuttx/configs/stm32ldiscovery/src/stm32_nsh.c
+++ b/nuttx/configs/stm32ldiscovery/src/stm32_nsh.c
@@ -40,7 +40,7 @@
#include <nuttx/config.h>
-#include <debug.h>
+#include <syslog.h>
#include <arch/board/board.h>
@@ -50,24 +50,6 @@
* 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
****************************************************************************/
diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c
index 30820b61f..6c89c1854 100644
--- a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c
+++ b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c
@@ -41,7 +41,7 @@
#include <stdio.h>
#include <unistd.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -141,22 +141,6 @@
# undef NSH_HAVE_USBMONITOR
#endif
-/* Debug ********************************************************************/
-
-#ifdef CONFIG_CPP_HAVE_VARARGS
-# ifdef CONFIG_DEBUG
-# define message(...) lowsyslog(__VA_ARGS__)
-# else
-# define message(...) printf(__VA_ARGS__)
-# endif
-#else
-# ifdef CONFIG_DEBUG
-# define message lowsyslog
-# else
-# define message printf
-# endif
-#endif
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -183,7 +167,7 @@ static int nsh_waiter(int argc, char *argv[])
bool connected = false;
int ret;
- message("nsh_waiter: Running\n");
+ syslog(LOG_INFO, "nsh_waiter: Running\n");
for (;;)
{
/* Wait for the device to change state */
@@ -192,7 +176,8 @@ static int nsh_waiter(int argc, char *argv[])
DEBUGASSERT(ret == OK);
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? */
@@ -229,14 +214,14 @@ static int nsh_sdinitialize(void)
spi = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!spi)
{
- message("nsh_archinitialize: Failed to initialize SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
ret = -ENODEV;
goto errout;
}
- message("Successfully initialized SPI port %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO);
+ syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO);
/* The SPI should be in 8-bit (default) and mode2: CKP=1, CKE=0.
* The MMC/SD driver will control the SPI frequency. WARNING:
@@ -253,16 +238,16 @@ static int nsh_sdinitialize(void)
CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0)
{
- message("nsh_sdinitialize: "
- "Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO, ret);
+ syslog(LOG_ERR,
+ "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO, ret);
goto errout;
}
- message("Successfuly bound SPI port %d to MMC/SD slot %d\n",
- CONFIG_NSH_MMCSDSPIPORTNO,
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n",
+ CONFIG_NSH_MMCSDSPIPORTNO,
+ CONFIG_NSH_MMCSDSLOTNO);
return OK;
errout:
@@ -290,22 +275,24 @@ static int nsh_usbhostinitialize(void)
* that we care about:
*/
- message("nsh_usbhostinitialize: Register class drivers\n");
+ syslog(LOG_INFO, "Register class drivers\n");
+
ret = usbhost_storageinit();
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 */
- message("nsh_usbhostinitialize: Initialize USB host\n");
+ syslog(LOG_INFO, "Initialize USB host\n");
+
g_usbconn = pic32_usbhost_initialize(0);
if (g_usbconn)
{
/* 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,
CONFIG_USBHOST_STACKSIZE,
diff --git a/nuttx/configs/tm4c123g-launchpad/src/tm4c_nsh.c b/nuttx/configs/tm4c123g-launchpad/src/tm4c_nsh.c
index 88cc3544c..54fe013d3 100644
--- a/nuttx/configs/tm4c123g-launchpad/src/tm4c_nsh.c
+++ b/nuttx/configs/tm4c123g-launchpad/src/tm4c_nsh.c
@@ -40,7 +40,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
@@ -58,22 +58,6 @@
# undef NSH_HAVEUSBDEV
#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
****************************************************************************/
diff --git a/nuttx/configs/twr-k60n512/src/up_nsh.c b/nuttx/configs/twr-k60n512/src/up_nsh.c
index 8069e3f96..7d3e35009 100644
--- a/nuttx/configs/twr-k60n512/src/up_nsh.c
+++ b/nuttx/configs/twr-k60n512/src/up_nsh.c
@@ -42,7 +42,7 @@
#include <stdbool.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#ifdef CONFIG_KINETIS_SDHC
@@ -105,22 +105,6 @@
# error "CONFIG_KINETIS_PORTEINTS required for card detect interrupt"
#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
****************************************************************************/
@@ -231,29 +215,30 @@ int nsh_archinitialize(void)
/* Mount the SDHC-based MMC/SD block driver */
/* First, get an instance of the SDHC interface */
- message("nsh_archinitialize: Initializing SDHC slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_INFO, "Initializing SDHC slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
g_nsh.sdhc = sdhc_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!g_nsh.sdhc)
{
- message("nsh_archinitialize: Failed to initialize SDHC slot %d\n",
- CONFIG_NSH_MMCSDSLOTNO);
+ syslog(LOG_ERR, "ERROR: Failed to initialize SDHC slot %d\n",
+ CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
}
/* Now bind the SDHC interface to the MMC/SD driver */
- message("nsh_archinitialize: Bind SDHC to the MMC/SD driver, minor=%d\n",
- CONFIG_NSH_MMCSDMINOR);
+ syslog(LOG_INFO, "Bind SDHC to the MMC/SD driver, minor=%d\n",
+ CONFIG_NSH_MMCSDMINOR);
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc);
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;
}
- 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 */
diff --git a/nuttx/configs/ubw32/src/up_nsh.c b/nuttx/configs/ubw32/src/up_nsh.c
index 7c6452004..64de3cdef 100644
--- a/nuttx/configs/ubw32/src/up_nsh.c
+++ b/nuttx/configs/ubw32/src/up_nsh.c
@@ -41,7 +41,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include "pic32mx-internal.h"
#include "ubw32-internal.h"
@@ -50,22 +50,6 @@
* 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
-
/****************************************************************************
* Private Data
****************************************************************************/
diff --git a/nuttx/configs/viewtool-stm32f107/src/stm32_nsh.c b/nuttx/configs/viewtool-stm32f107/src/stm32_nsh.c
index 265d90ed0..f79672f58 100644
--- a/nuttx/configs/viewtool-stm32f107/src/stm32_nsh.c
+++ b/nuttx/configs/viewtool-stm32f107/src/stm32_nsh.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <syslog.h>
#include "viewtool_stm32f107.h"
@@ -63,22 +64,6 @@
#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
****************************************************************************/
diff --git a/nuttx/configs/zkit-arm-1769/src/up_nsh.c b/nuttx/configs/zkit-arm-1769/src/up_nsh.c
index a74c8796f..5e28d637d 100644
--- a/nuttx/configs/zkit-arm-1769/src/up_nsh.c
+++ b/nuttx/configs/zkit-arm-1769/src/up_nsh.c
@@ -46,7 +46,7 @@
#include <nuttx/config.h>
#include <stdio.h>
-#include <debug.h>
+#include <syslog.h>
#include <errno.h>
#include <nuttx/spi/spi.h>
diff --git a/nuttx/include/syslog.h b/nuttx/include/syslog.h
index 6aebb367e..c71d95176 100644
--- a/nuttx/include/syslog.h
+++ b/nuttx/include/syslog.h
@@ -89,19 +89,20 @@
* of decreasing importance:
*/
-#define LOG_EMERG 7 /* System is unusable */
-#define LOG_ALERT 6 /* Action must be taken immediately */
-#define LOG_CRIT 5 /* Critical conditions */
-#define LOG_ERR 4 /* Error conditions */
-#define LOG_WARNING 3 /* Warning conditions */
-#define LOG_NOTICE 2 /* Normal, but significant, condition */
-#define LOG_INFO 1 /* Informational message */
-#define LOG_DEBUG 0 /* Debug-level message */
+#define LOG_EMERG 0 /* System is unusable */
+#define LOG_ALERT 1 /* Action must be taken immediately */
+#define LOG_CRIT 2 /* Critical conditions */
+#define LOG_ERR 3 /* Error conditions */
+#define LOG_WARNING 4 /* Warning conditions */
+#define LOG_NOTICE 5 /* Normal, but significant, condition */
+#define LOG_INFO 6 /* Informational message */
+#define LOG_DEBUG 7 /* Debug-level message */
/* Used with setlogmask() */
#define LOG_MASK(p) (1 << (p))
#define LOG_UPTO(p) ((1 << (p)) - 1)
+#define LOG_ALL 0xff
/****************************************************************************
* Public Type Declarations