From 8c1e954b84e3cc850650589e01c4b32fedb2f70d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Oct 2014 14:59:10 -0600 Subject: [PATCH] All USB MSC-related files under nuttx/configs changed to use the corrected syslog interfaces --- configs/cloudctrl/src/up_usbmsc.c | 22 +------- configs/fire-stm32v2/src/up_usbmsc.c | 22 +------- configs/hymini-stm32v/src/up_usbmsc.c | 46 ++++------------- configs/kwikstik-k40/src/up_usbmsc.c | 23 +-------- configs/lpcxpresso-lpc1768/src/up_usbmsc.c | 47 +++++------------ configs/mcu123-lpc214x/src/up_usbmsc.c | 51 ++++++------------- configs/nucleus2g/src/up_usbmsc.c | 51 ++++++------------- configs/olimex-lpc1766stk/src/lpc17_usbmsc.c | 51 +++++++------------ configs/pcduino-a10/nsh/pcduino-140107.patch | 18 +++---- configs/pic32-starterkit/src/up_usbmsc.c | 22 -------- configs/pic32mx7mmb/src/up_usbmsc.c | 22 -------- configs/sam3u-ek/src/up_usbmsc.c | 45 +++++----------- configs/sam4e-ek/src/sam_usbmsc.c | 28 ++-------- configs/sama5d3-xplained/src/sam_usbmsc.c | 24 +-------- configs/sama5d3x-ek/src/sam_usbmsc.c | 24 +-------- configs/sama5d4-ek/src/sam_usbmsc.c | 24 +-------- configs/shenzhou/src/up_usbmsc.c | 22 +------- configs/stm3210e-eval/src/up_usbmsc.c | 48 +++++------------ configs/teensy/src/up_usbmsc.c | 30 ++--------- configs/twr-k60n512/src/up_usbmsc.c | 23 +-------- configs/viewtool-stm32f107/src/stm32_usbmsc.c | 22 +------- configs/zkit-arm-1769/src/up_usbmsc.c | 51 +++++++------------ 22 files changed, 144 insertions(+), 572 deletions(-) diff --git a/configs/cloudctrl/src/up_usbmsc.c b/configs/cloudctrl/src/up_usbmsc.c index 57888986b9..5c9481b8f3 100644 --- a/configs/cloudctrl/src/up_usbmsc.c +++ b/configs/cloudctrl/src/up_usbmsc.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include "stm32.h" @@ -57,26 +57,6 @@ # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/fire-stm32v2/src/up_usbmsc.c b/configs/fire-stm32v2/src/up_usbmsc.c index 41f966e9db..1bb0059153 100644 --- a/configs/fire-stm32v2/src/up_usbmsc.c +++ b/configs/fire-stm32v2/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "stm32.h" @@ -56,26 +56,6 @@ # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/hymini-stm32v/src/up_usbmsc.c b/configs/hymini-stm32v/src/up_usbmsc.c index 7a47f7b9aa..c3f91cf13c 100644 --- a/configs/hymini-stm32v/src/up_usbmsc.c +++ b/configs/hymini-stm32v/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -74,27 +74,6 @@ # error "Unrecognized STM32 board" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -120,34 +99,31 @@ int usbmsc_archinitialize(void) /* First, get an instance of the SDIO interface */ - message("usbmsc_archinitialize: " - "Initializing SDIO slot %d\n", - STM32_MMCSDSLOTNO); + syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO); sdio = sdio_initialize(STM32_MMCSDSLOTNO); if (!sdio) { - message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n", - STM32_MMCSDSLOTNO); + syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n", + STM32_MMCSDSLOTNO); return -ENODEV; } /* Now bind the SDIO interface to the MMC/SD driver */ - message("usbmsc_archinitialize: " - "Bind SDIO to the MMC/SD driver, minor=%d\n", - CONFIG_SYSTEM_USBMSC_DEVMINOR1); + syslog(LOG_INFO,"Bind SDIO to the MMC/SD driver, minor=%d\n", + CONFIG_SYSTEM_USBMSC_DEVMINOR1); ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio); if (ret != OK) { - message("usbmsc_archinitialize: " - "Failed to bind SDIO to the MMC/SD driver: %d\n", - ret); + syslog(LOG_ERR, "" + "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", + ret); return ret; } - message("usbmsc_archinitialize: " - "Successfully bound SDIO to the MMC/SD driver\n"); + + syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n"); /* Then let's guess and say that there is a card in the slot. I need to check to * see if the Hy-Mini STM32v board supports a GPIO to detect if there is a card in diff --git a/configs/kwikstik-k40/src/up_usbmsc.c b/configs/kwikstik-k40/src/up_usbmsc.c index 53bdbb4020..2aa39fd9cd 100644 --- a/configs/kwikstik-k40/src/up_usbmsc.c +++ b/configs/kwikstik-k40/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -70,27 +70,6 @@ # error "Unrecognized Kinetis 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 ****************************************************************************/ diff --git a/configs/lpcxpresso-lpc1768/src/up_usbmsc.c b/configs/lpcxpresso-lpc1768/src/up_usbmsc.c index 291f244d91..6ece902040 100644 --- a/configs/lpcxpresso-lpc1768/src/up_usbmsc.c +++ b/configs/lpcxpresso-lpc1768/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -70,27 +70,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 ****************************************************************************/ @@ -110,34 +89,34 @@ 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); return -ENODEV; } - 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); 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); return ret; } - 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; } diff --git a/configs/mcu123-lpc214x/src/up_usbmsc.c b/configs/mcu123-lpc214x/src/up_usbmsc.c index 5f9a4e509f..45182d0a6c 100644 --- a/configs/mcu123-lpc214x/src/up_usbmsc.c +++ b/configs/mcu123-lpc214x/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -70,27 +70,6 @@ # error "Unrecognized LPC214x board" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -110,34 +89,36 @@ int usbmsc_archinitialize(void) /* Get the SPI port */ - message("usbmsc_archinitialize: Initializing SPI port %d\n", - LPC214X_MMCSDSPIPORTNO); + syslog(LOG_INFO, "Initializing SPI port %d\n", + LPC214X_MMCSDSPIPORTNO); spi = up_spiinitialize(LPC214X_MMCSDSPIPORTNO); if (!spi) { - message("usbmsc_archinitialize: Failed to initialize SPI port %d\n", - LPC214X_MMCSDSPIPORTNO); + syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n", + LPC214X_MMCSDSPIPORTNO); return -ENODEV; } - message("usbmsc_archinitialize: Successfully initialized SPI port %d\n", - LPC214X_MMCSDSPIPORTNO); + syslog(LOG_INFO, "Successfully initialized SPI port %d\n", + LPC214X_MMCSDSPIPORTNO); /* Bind the SPI port to the slot */ - message("usbmsc_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", - LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); + syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", + LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC214X_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, + LPC214X_MMCSDSLOTNO, spi); if (ret < 0) { - message("usbmsc_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", - LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret); + syslog(LOG_ERR, + "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret); return ret; } - message("usbmsc_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", - LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); + syslog(LOG_INFO, "Successfully bound SPI port %d to MMC/SD slot %d\n", + LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); return OK; } diff --git a/configs/nucleus2g/src/up_usbmsc.c b/configs/nucleus2g/src/up_usbmsc.c index ca8f6f7b73..7fc4a12420 100644 --- a/configs/nucleus2g/src/up_usbmsc.c +++ b/configs/nucleus2g/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -70,27 +70,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 ****************************************************************************/ @@ -110,34 +89,36 @@ 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); return -ENODEV; } - 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); return ret; } - 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; } diff --git a/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c b/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c index 221ed41b4b..4bd40eb2c8 100644 --- a/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c +++ b/configs/olimex-lpc1766stk/src/lpc17_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -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. */ diff --git a/configs/pcduino-a10/nsh/pcduino-140107.patch b/configs/pcduino-a10/nsh/pcduino-140107.patch index e6a1b9c18c..50d4a0aca1 100644 --- a/configs/pcduino-a10/nsh/pcduino-140107.patch +++ b/configs/pcduino-a10/nsh/pcduino-140107.patch @@ -6,14 +6,14 @@ index 3cc6323..ad42790 100644 * for all IO regions (Including the vector region). */ -+lowsyslog("Calling a1x_setupmappings\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling a1x_setupmappings\n"); // REMOVE ME a1x_setupmappings(); /* Provide a special mapping for the IRAM interrupt vector positioned in * high memory. */ -+lowsyslog("Calling a1x_vectormapping\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling a1x_vectormapping\n"); // REMOVE ME a1x_vectormapping(); #endif /* CONFIG_ARCH_ROMPGTABLE */ @@ -21,19 +21,19 @@ index 3cc6323..ad42790 100644 * arm_vector.S */ -+lowsyslog("Calling a1x_copyvectorblock\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling a1x_copyvectorblock\n"); // REMOVE ME a1x_copyvectorblock(); /* Initialize the FPU */ #ifdef CONFIG_ARCH_FPU -+lowsyslog("Calling arm_fpuconfig\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling arm_fpuconfig\n"); // REMOVE ME arm_fpuconfig(); #endif /* Perform common, low-level chip initialization (might do nothing) */ -+lowsyslog("Calling a1x_lowsetup\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling a1x_lowsetup\n"); // REMOVE ME a1x_lowsetup(); /* Perform early serial initialization if we are going to use the serial @@ -41,7 +41,7 @@ index 3cc6323..ad42790 100644 */ #ifdef USE_EARLYSERIALINIT -+lowsyslog("Calling up_earlyserialinit\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling up_earlyserialinit\n"); // REMOVE ME up_earlyserialinit(); #endif @@ -49,7 +49,7 @@ index 3cc6323..ad42790 100644 */ #ifdef CONFIG_BUILD_PROTECTED -+lowsyslog("Calling a1x_userspace\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling a1x_userspace\n"); // REMOVE ME a1x_userspace(); #endif @@ -57,9 +57,9 @@ index 3cc6323..ad42790 100644 * - Configuration of board specific resources (PIOs, LEDs, etc). */ -+lowsyslog("Calling a1x_boardinitialize\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Calling a1x_boardinitialize\n"); // REMOVE ME a1x_boardinitialize(); -+lowsyslog("Returning\n"); // REMOVE ME ++lowsyslog(LOG_INFO, "Returning\n"); // REMOVE ME } diff --git a/nuttx/arch/arm/src/armv7-a/arm_head.S b/nuttx/arch/arm/src/armv7-a/arm_head.S index bce82d5..924bd24 100644 diff --git a/configs/pic32-starterkit/src/up_usbmsc.c b/configs/pic32-starterkit/src/up_usbmsc.c index 535754f156..0d010ed68b 100644 --- a/configs/pic32-starterkit/src/up_usbmsc.c +++ b/configs/pic32-starterkit/src/up_usbmsc.c @@ -44,28 +44,6 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ -/* Configuration ************************************************************/ - -/* 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 diff --git a/configs/pic32mx7mmb/src/up_usbmsc.c b/configs/pic32mx7mmb/src/up_usbmsc.c index 7038bb635d..3cbb58a115 100644 --- a/configs/pic32mx7mmb/src/up_usbmsc.c +++ b/configs/pic32mx7mmb/src/up_usbmsc.c @@ -44,28 +44,6 @@ /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ -/* Configuration ************************************************************/ - -/* 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 diff --git a/configs/sam3u-ek/src/up_usbmsc.c b/configs/sam3u-ek/src/up_usbmsc.c index 99a8f365d4..8c92620204 100644 --- a/configs/sam3u-ek/src/up_usbmsc.c +++ b/configs/sam3u-ek/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -67,26 +67,6 @@ #undef SAM_MMCSDSLOTNO #define SAM_MMCSDSLOTNO 0 -/* 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 ****************************************************************************/ @@ -106,34 +86,33 @@ int usbmsc_archinitialize(void) /* First, get an instance of the SDIO interface */ - message("usbmsc_archinitialize: " - "Initializing SDIO slot %d\n", + syslg(LOG_INFO, "Initializing SDIO slot %d\n", SAM_MMCSDSLOTNO); sdio = sdio_initialize(SAM_MMCSDSLOTNO); if (!sdio) { - message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n", - SAM_MMCSDSLOTNO); + syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n", + SAM_MMCSDSLOTNO); return -ENODEV; } /* Now bind the SPI interface to the MMC/SD driver */ - message("usbmsc_archinitialize: " - "Bind SDIO to the MMC/SD driver, minor=%d\n", - CONFIG_SYSTEM_USBMSC_DEVMINOR1); + syslog(LOG_INFO, "" + "Bind SDIO to the MMC/SD driver, minor=%d\n", + CONFIG_SYSTEM_USBMSC_DEVMINOR1); ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio); if (ret != OK) { - message("usbmsc_archinitialize: " - "Failed to bind SDIO to the MMC/SD driver: %d\n", - ret); + syslog(LOG_ERR, + "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", + ret); return ret; } - message("usbmsc_archinitialize: " - "Successfully bound SDIO to the MMC/SD driver\n"); + + syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n"); /* Then let's guess and say that there is a card in the slot. I need to check to * see if the SAM3U10E-EVAL board supports a GPIO to detect if there is a card in diff --git a/configs/sam4e-ek/src/sam_usbmsc.c b/configs/sam4e-ek/src/sam_usbmsc.c index ad5571107b..e8bafad56e 100644 --- a/configs/sam4e-ek/src/sam_usbmsc.c +++ b/configs/sam4e-ek/src/sam_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "sam4e-ek.h" @@ -74,26 +74,6 @@ # undef CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE #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 ****************************************************************************/ @@ -114,7 +94,7 @@ int usbmsc_archinitialize(void) int 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; @@ -122,10 +102,10 @@ int usbmsc_archinitialize(void) #elif defined(CONFIG_SAM4EEK_HSMCI_BLOCKDEVICE) /* Initialize the HSMCI driver */ - ret = sam_hsmci_initialize(0); + int 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; diff --git a/configs/sama5d3-xplained/src/sam_usbmsc.c b/configs/sama5d3-xplained/src/sam_usbmsc.c index 2f983fdcde..19388c07e2 100644 --- a/configs/sama5d3-xplained/src/sam_usbmsc.c +++ b/configs/sama5d3-xplained/src/sam_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "sama5d3-xplained.h" @@ -73,26 +73,6 @@ # undef HAVE_AT25 #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 ****************************************************************************/ @@ -113,7 +93,7 @@ int usbmsc_archinitialize(void) int 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; diff --git a/configs/sama5d3x-ek/src/sam_usbmsc.c b/configs/sama5d3x-ek/src/sam_usbmsc.c index 6ad938efaa..d2ddfa8ee1 100644 --- a/configs/sama5d3x-ek/src/sam_usbmsc.c +++ b/configs/sama5d3x-ek/src/sam_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "sama5d3x-ek.h" @@ -73,26 +73,6 @@ # undef HAVE_AT25 #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 ****************************************************************************/ @@ -113,7 +93,7 @@ int usbmsc_archinitialize(void) int 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; diff --git a/configs/sama5d4-ek/src/sam_usbmsc.c b/configs/sama5d4-ek/src/sam_usbmsc.c index 90a68dd2ed..51b1b8a86e 100644 --- a/configs/sama5d4-ek/src/sam_usbmsc.c +++ b/configs/sama5d4-ek/src/sam_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "sama5d4-ek.h" @@ -73,26 +73,6 @@ # undef HAVE_AT25 #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 ****************************************************************************/ @@ -113,7 +93,7 @@ int usbmsc_archinitialize(void) int 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; diff --git a/configs/shenzhou/src/up_usbmsc.c b/configs/shenzhou/src/up_usbmsc.c index 848b44bcb9..fe6b4fbc17 100644 --- a/configs/shenzhou/src/up_usbmsc.c +++ b/configs/shenzhou/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "stm32.h" @@ -56,26 +56,6 @@ # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/stm3210e-eval/src/up_usbmsc.c b/configs/stm3210e-eval/src/up_usbmsc.c index 53fbabcccd..3b37744d3c 100644 --- a/configs/stm3210e-eval/src/up_usbmsc.c +++ b/configs/stm3210e-eval/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -74,27 +74,6 @@ # error "Unrecognized STM32 board" #endif -/* Debug ********************************************************************/ - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef CONFIG_DEBUG -# define message(...) lowsyslog(__VA_ARGS__) -# define msgflush() -# else -# define message(...) printf(__VA_ARGS__) -# define msgflush() fflush(stdout) -# endif -#else -# ifdef CONFIG_DEBUG -# define message lowsyslog -# define msgflush() -# else -# define message printf -# define msgflush() fflush(stdout) -# endif -#endif - - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -110,7 +89,7 @@ int usbmsc_archinitialize(void) { /* If system/usbmsc is built as an NSH command, then SD slot should - * already have been initized in nsh_archinitialize() (see up_nsh.c). In + * already have been initialized in nsh_archinitialize() (see up_nsh.c). In * this case, there is nothing further to be done here. */ @@ -120,34 +99,31 @@ int usbmsc_archinitialize(void) /* First, get an instance of the SDIO interface */ - message("usbmsc_archinitialize: " - "Initializing SDIO slot %d\n", - STM32_MMCSDSLOTNO); + syslog(LOG_INFO, "Initializing SDIO slot %d\n", STM32_MMCSDSLOTNO); sdio = sdio_initialize(STM32_MMCSDSLOTNO); if (!sdio) { - message("usbmsc_archinitialize: Failed to initialize SDIO slot %d\n", - STM32_MMCSDSLOTNO); + syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n", + STM32_MMCSDSLOTNO); return -ENODEV; } /* Now bind the SDIO interface to the MMC/SD driver */ - message("usbmsc_archinitialize: " - "Bind SDIO to the MMC/SD driver, minor=%d\n", - CONFIG_SYSTEM_USBMSC_DEVMINOR1); + syslog(LOG_INFO, "Bind SDIO to the MMC/SD driver, minor=%d\n", + CONFIG_SYSTEM_USBMSC_DEVMINOR1); ret = mmcsd_slotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, sdio); if (ret != OK) { - message("usbmsc_archinitialize: " - "Failed to bind SDIO to the MMC/SD driver: %d\n", - ret); + syslog(LOG_ERR, + "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", + ret); return ret; } - message("usbmsc_archinitialize: " - "Successfully bound SDIO to the MMC/SD driver\n"); + + syslog(LOG_INFO, "Successfully bound SDIO to the MMC/SD driver\n"); /* Then let's guess and say that there is a card in the slot. I need to check to * see if the STM3210E-EVAL board supports a GPIO to detect if there is a card in diff --git a/configs/teensy/src/up_usbmsc.c b/configs/teensy/src/up_usbmsc.c index daed5d13d6..c467d4324d 100644 --- a/configs/teensy/src/up_usbmsc.c +++ b/configs/teensy/src/up_usbmsc.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -74,26 +74,6 @@ # error "Unrecognized AVR 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 ****************************************************************************/ @@ -113,23 +93,23 @@ int usbmsc_archinitialize(void) /* Get the SPI port */ - message("Initializing SPI port\n"); + syslog(LOG_INFO, "Initializing SPI port\n"); spi = up_spiinitialize(AVR_MMCSDSPIPORTNO); if (!spi) { - message("up_spiinitialize failed\n"); + syslog(LOG_ERR, "ERROR: up_spiinitialize failed\n"); return -ENODEV; } /* Bind the SPI port to the slot */ - message("Binding SPI port to MMC/SD slot\n"); + syslog(LOG_INFO, "Binding SPI port to MMC/SD slot\n"); ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, AVR_MMCSDSLOTNO, spi); if (ret < 0) { - message("mmcsd_spislotinitialize failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: mmcsd_spislotinitialize failed: %d\n", ret); return ret; } diff --git a/configs/twr-k60n512/src/up_usbmsc.c b/configs/twr-k60n512/src/up_usbmsc.c index d0e7f66c25..8d67c08bd0 100644 --- a/configs/twr-k60n512/src/up_usbmsc.c +++ b/configs/twr-k60n512/src/up_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include @@ -70,27 +70,6 @@ # error "Unrecognized Kinetis 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 ****************************************************************************/ diff --git a/configs/viewtool-stm32f107/src/stm32_usbmsc.c b/configs/viewtool-stm32f107/src/stm32_usbmsc.c index d469013d3c..3df657693f 100644 --- a/configs/viewtool-stm32f107/src/stm32_usbmsc.c +++ b/configs/viewtool-stm32f107/src/stm32_usbmsc.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "stm32.h" @@ -57,26 +57,6 @@ # define CONFIG_SYSTEM_USBMSC_DEVMINOR1 VIEWTOOL_MMCSD_SLOTNO #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 ****************************************************************************/ diff --git a/configs/zkit-arm-1769/src/up_usbmsc.c b/configs/zkit-arm-1769/src/up_usbmsc.c index 9a4862fd5e..a1703e52e3 100644 --- a/configs/zkit-arm-1769/src/up_usbmsc.c +++ b/configs/zkit-arm-1769/src/up_usbmsc.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include @@ -78,26 +78,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 ****************************************************************************/ @@ -117,34 +97,37 @@ 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); + zkit_spiinitialize(); spi = lpc17_spiinitialize(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); return -ENODEV; } - 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); return ret; } - 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; }