diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 14:59:10 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 14:59:10 -0600 |
commit | 14306ef863a31b5983c13e276837a55f9c834a2c (patch) | |
tree | 4c9ed2b57125c6890005fb6166926b3847e47cb6 /nuttx/configs/olimex-lpc1766stk | |
parent | ea13b6e3d0dc0770d4c493ee7a6d1d9f9b884a45 (diff) | |
download | px4-nuttx-14306ef863a31b5983c13e276837a55f9c834a2c.tar.gz px4-nuttx-14306ef863a31b5983c13e276837a55f9c834a2c.tar.bz2 px4-nuttx-14306ef863a31b5983c13e276837a55f9c834a2c.zip |
All USB MSC-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_usbmsc.c | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/nuttx/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c b/nuttx/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c index 221ed41b4..4bd40eb2c 100644 --- a/nuttx/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c +++ b/nuttx/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c @@ -42,7 +42,7 @@ #include <nuttx/config.h> #include <stdio.h> -#include <debug.h> +#include <syslog.h> #include <errno.h> #include <nuttx/spi/spi.h> @@ -73,26 +73,6 @@ # error "Unrecognized LPC17xx board" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -116,36 +96,39 @@ int usbmsc_archinitialize(void) /* Get the SPI port */ - message("usbmsc_archinitialize: Initializing SPI port %d\n", - LPC17XX_MMCSDSPIPORTNO); + syslog(LOG_INFO, "Initializing SPI port %d\n", + LPC17XX_MMCSDSPIPORTNO); spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO); if (!spi) { - message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", - LPC17XX_MMCSDSPIPORTNO); + syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n", + LPC17XX_MMCSDSPIPORTNO); ret = -ENODEV; goto errout; } - message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", - LPC17XX_MMCSDSPIPORTNO); + syslog(LOG_INFO, "Successfully initialized SPI port %d\n", + LPC17XX_MMCSDSPIPORTNO); /* Bind the SPI port to the slot */ - message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", - LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); + syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", + LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, + LPC17XX_MMCSDSLOTNO, spi); if (ret < 0) { - message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", - LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); + syslog(LOG_ERR, + "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO, ret); goto errout; } - message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", - LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); + syslog(LOG_INFO, + "Successfully bound SPI port %d to MMC/SD slot %d\n", + LPC17XX_MMCSDSPIPORTNO, LPC17XX_MMCSDSLOTNO); return OK; /* Disable power to the SD/MMC via a GPIO. HIGH disables SD/MMC. */ |