diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 14:28:55 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 14:28:55 -0600 |
commit | ea13b6e3d0dc0770d4c493ee7a6d1d9f9b884a45 (patch) | |
tree | 03e459590b0f781d06f0f23fa6d84c1c31433a82 /nuttx/configs/olimex-lpc1766stk | |
parent | fe77b16ab68a41379e4d9f84e5a29d6bd9fd1323 (diff) | |
download | px4-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
Diffstat (limited to 'nuttx/configs/olimex-lpc1766stk')
-rw-r--r-- | nuttx/configs/olimex-lpc1766stk/src/lpc17_nsh.c | 51 |
1 files changed, 18 insertions, 33 deletions
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 |