From 2b77c9ceb98778808e69c0514ff54cbdee627fe5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Oct 2014 15:32:00 -0600 Subject: [PATCH] Remaining files under nuttx/configs changed to use the corrected syslog interfaces --- configs/ea3131/src/up_usbmsc.c | 8 ++-- configs/px4fmu-v2_upstream/src/px4fmu2_init.c | 34 ++++--------- configs/sam4e-ek/src/sam_ili9325.c | 6 +-- configs/sam4e-ek/src/sam_ili9341.c | 7 +-- configs/sama5d4-ek/src/sam_bringup.c | 48 +++++++++---------- configs/shenzhou/src/up_ili93xx.c | 7 +-- configs/stm3210e-eval/src/up_lcd.c | 6 +-- configs/stm3210e-eval/src/up_pmbuttons.c | 2 +- configs/stm3240g-eval/src/up_lcd.c | 6 +-- .../stm32f4discovery/src/stm32_pmbuttons.c | 6 +-- configs/vsn/src/vsn.h | 19 -------- 11 files changed, 57 insertions(+), 92 deletions(-) diff --git a/configs/ea3131/src/up_usbmsc.c b/configs/ea3131/src/up_usbmsc.c index aee0224901..b80ea35be3 100644 --- a/configs/ea3131/src/up_usbmsc.c +++ b/configs/ea3131/src/up_usbmsc.c @@ -92,7 +92,7 @@ int usbmsc_archinitialize(void) pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE); if (!pbuffer) { - lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", + lowsyslog(LOG_ERR, "ERROR: Failed to allocate ramdisk of size %d\n", BUFFER_SIZE); return -ENOMEM; } @@ -106,7 +106,8 @@ int usbmsc_archinitialize(void) true); if (ret < 0) { - printf("create_ramdisk: Failed to register ramdisk at %s: %d\n", + syslog(LOG_ERR, + "ERROR: create_ramdisk: Failed to register ramdisk at %s: %d\n", g_source, -ret); kmm_free(pbuffer); return ret; @@ -117,7 +118,8 @@ int usbmsc_archinitialize(void) ret = mkfatfs(g_source, &g_fmt); if (ret < 0) { - printf("create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n", + syslog(LOG_ERR, + "ERROR: create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n", g_source); /* kmm_free(pbuffer); -- RAM disk is registered */ return ret; diff --git a/configs/px4fmu-v2_upstream/src/px4fmu2_init.c b/configs/px4fmu-v2_upstream/src/px4fmu2_init.c index dfa061e9da..e2813c89fd 100644 --- a/configs/px4fmu-v2_upstream/src/px4fmu2_init.c +++ b/configs/px4fmu-v2_upstream/src/px4fmu2_init.c @@ -83,22 +83,6 @@ #define LED_BLUE 0 #define LED_SAFETY 2 -/* 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 ****************************************************************************/ @@ -138,7 +122,7 @@ static void dma_alloc_init(void) if (dma_allocator == NULL) { - message("[boot] DMA allocator setup FAILED"); + syslog(LOG_INFO, "[boot] DMA allocator setup FAILED"); } } #else @@ -239,7 +223,7 @@ int nsh_archinitialize(void) spi1 = up_spiinitialize(1); if (!spi1) { - message("[boot] FAILED to initialize SPI port 1\n"); + syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 1\n"); board_led_on(LED_AMBER); return -ENODEV; } @@ -255,14 +239,14 @@ int nsh_archinitialize(void) SPI_SELECT(spi1, PX4_SPIDEV_MPU, false); up_udelay(20); - message("[boot] Initialized SPI port 1 (SENSORS)\n"); + syslog(LOG_INFO, "[boot] Initialized SPI port 1 (SENSORS)\n"); /* Get the SPI port for the FRAM */ spi2 = up_spiinitialize(2); if (!spi2) { - message("[boot] FAILED to initialize SPI port 2\n"); + syslog(LOG_ERR, "[boot] FAILED to initialize SPI port 2\n"); board_led_on(LED_AMBER); return -ENODEV; } @@ -278,7 +262,7 @@ int nsh_archinitialize(void) SPI_SETMODE(spi2, SPIDEV_MODE3); SPI_SELECT(spi2, SPIDEV_FLASH, false); - message("[boot] Initialized SPI port 2 (RAMTRON FRAM)\n"); + syslog(LOG_INFO, "[boot] Initialized SPI port 2 (RAMTRON FRAM)\n"); #ifdef CONFIG_MMCSD /* First, get an instance of the SDIO interface */ @@ -286,8 +270,8 @@ int nsh_archinitialize(void) sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); if (!sdio) { - message("[boot] Failed to initialize SDIO slot %d\n", - CONFIG_NSH_MMCSDSLOTNO); + syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n", + CONFIG_NSH_MMCSDSLOTNO); return -ENODEV; } @@ -296,7 +280,7 @@ int nsh_archinitialize(void) ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); if (ret != OK) { - message("[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, "[boot] Failed to bind SDIO to the MMC/SD driver: %d\n", ret); return ret; } @@ -306,7 +290,7 @@ int nsh_archinitialize(void) sdio_mediachange(sdio, true); - message("[boot] Initialized SDIO\n"); + syslog(LOG_INFO, "[boot] Initialized SDIO\n"); #endif return OK; diff --git a/configs/sam4e-ek/src/sam_ili9325.c b/configs/sam4e-ek/src/sam_ili9325.c index bc68839236..eb419c467d 100644 --- a/configs/sam4e-ek/src/sam_ili9325.c +++ b/configs/sam4e-ek/src/sam_ili9325.c @@ -577,14 +577,14 @@ static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels) { int i, j; - syslog("\n%s:\n", msg); + syslog(LOG_DEBUG, "\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - syslog(" "); + syslog(LOG_DEBUG, " "); for (j = 0; j < 16; j++) { - syslog(" %04x", *run++); + syslog(LOG_DEBUG, " %04x", *run++); } up_putc('\n'); } diff --git a/configs/sam4e-ek/src/sam_ili9341.c b/configs/sam4e-ek/src/sam_ili9341.c index 9c23e18f45..6e54073ee9 100644 --- a/configs/sam4e-ek/src/sam_ili9341.c +++ b/configs/sam4e-ek/src/sam_ili9341.c @@ -608,15 +608,16 @@ static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels) { int i, j; - syslog("\n%s:\n", msg); + syslog(LOG_DEBUG, "\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - syslog(" "); + syslog(LOG_DEBUG, " "); for (j = 0; j < 16; j++) { - syslog(" %04x", *run++); + syslog(LOG_DEBUG, " %04x", *run++); } + up_putc('\n'); } } diff --git a/configs/sama5d4-ek/src/sam_bringup.c b/configs/sama5d4-ek/src/sam_bringup.c index f4782bd8cd..436d0253e2 100644 --- a/configs/sama5d4-ek/src/sam_bringup.c +++ b/configs/sama5d4-ek/src/sam_bringup.c @@ -70,13 +70,9 @@ /* Debug ********************************************************************/ #ifdef CONFIG_BOARD_INITIALIZE -# define message lldbg +# define SYSLOG lldbg #else -# ifdef CONFIG_CPP_HAVE_VARARGS -# define message(...) syslog(__VA_ARGS__) -# else -# define message syslog -# endif +# define SYSLOG dbg #endif /**************************************************************************** @@ -105,7 +101,7 @@ int sam_bringup(void) ret = sam_nand_automount(NAND_MINOR); if (ret < 0) { - message("ERROR: sam_nand_automount failed: %d\n", ret); + SYSLOG("ERROR: sam_nand_automount failed: %d\n", ret); } #endif @@ -115,7 +111,7 @@ int sam_bringup(void) ret = sam_at25_automount(AT25_MINOR); if (ret < 0) { - message("ERROR: sam_at25_automount failed: %d\n", ret); + SYSLOG("ERROR: sam_at25_automount failed: %d\n", ret); } #endif @@ -126,8 +122,8 @@ int sam_bringup(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("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", + HSMCI0_SLOTNO, HSMCI0_MINOR, ret); } #ifdef CONFIG_SAMA5D4EK_HSMCI0_MOUNT @@ -143,8 +139,8 @@ int sam_bringup(void) if (ret < 0) { - message("ERROR: Failed to mount %s: %d\n", - CONFIG_SAMA5D4EK_HSMCI0_MOUNT_MOUNTPOINT, errno); + SYSLOG("ERROR: Failed to mount %s: %d\n", + CONFIG_SAMA5D4EK_HSMCI0_MOUNT_MOUNTPOINT, errno); } } #endif @@ -156,8 +152,8 @@ int sam_bringup(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("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", + HSMCI1_SLOTNO, HSMCI1_MINOR, ret); } #ifdef CONFIG_SAMA5D4EK_HSMCI1_MOUNT @@ -173,8 +169,8 @@ int sam_bringup(void) if (ret < 0) { - message("ERROR: Failed to mount %s: %d\n", - CONFIG_SAMA5D4EK_HSMCI1_MOUNT_MOUNTPOINT, errno); + SYSLOG("ERROR: Failed to mount %s: %d\n", + CONFIG_SAMA5D4EK_HSMCI1_MOUNT_MOUNTPOINT, errno); } } #endif @@ -195,7 +191,7 @@ int sam_bringup(void) CONFIG_SAMA5D4EK_ROMFS_ROMDISK_SECTSIZE); if (ret < 0) { - message("ERROR: romdisk_register failed: %d\n", -ret); + SYSLOG("ERROR: romdisk_register failed: %d\n", -ret); } else { @@ -206,9 +202,9 @@ int sam_bringup(void) "romfs", MS_RDONLY, NULL); if (ret < 0) { - message("ERROR: mount(%s,%s,romfs) failed: %d\n", - CONFIG_SAMA5D4EK_ROMFS_ROMDISK_DEVNAME, - CONFIG_SAMA5D4EK_ROMFS_MOUNT_MOUNTPOINT, errno); + SYSLOG("ERROR: mount(%s,%s,romfs) failed: %d\n", + CONFIG_SAMA5D4EK_ROMFS_ROMDISK_DEVNAME, + CONFIG_SAMA5D4EK_ROMFS_MOUNT_MOUNTPOINT, errno); } } #endif @@ -221,7 +217,7 @@ int sam_bringup(void) ret = sam_usbhost_initialize(); if (ret != OK) { - message("ERROR: Failed to initialize USB host: %d\n", ret); + SYSLOG("ERROR: Failed to initialize USB host: %d\n", ret); } #endif @@ -231,7 +227,7 @@ int sam_bringup(void) ret = usbmonitor_start(0, NULL); if (ret != OK) { - message("ERROR: Failed to start the USB monitor: %d\n", ret); + SYSLOG("ERROR: Failed to start the USB monitor: %d\n", ret); } #endif @@ -241,7 +237,7 @@ int sam_bringup(void) ret = sam_wm8904_initialize(0); if (ret != OK) { - message("ERROR: Failed to initialize WM8904 audio: %d\n", ret); + SYSLOG("ERROR: Failed to initialize WM8904 audio: %d\n", ret); } #endif @@ -251,18 +247,18 @@ int sam_bringup(void) ret = sam_audio_null_initialize(0); if (ret != OK) { - message("ERROR: Failed to initialize the NULL audio device: %d\n", ret); + SYSLOG("ERROR: Failed to initialize the NULL audio device: %d\n", ret); } #endif #ifdef HAVE_ELF /* Initialize the ELF binary loader */ - message("Initializing the ELF binary loader\n"); + SYSLOG("Initializing the ELF binary loader\n"); ret = elf_initialize(); if (ret < 0) { - message("ERROR: Initialization of the ELF loader failed: %d\n", ret); + SYSLOG("ERROR: Initialization of the ELF loader failed: %d\n", ret); } #endif diff --git a/configs/shenzhou/src/up_ili93xx.c b/configs/shenzhou/src/up_ili93xx.c index 7467c0d1dc..cfe27cd95b 100644 --- a/configs/shenzhou/src/up_ili93xx.c +++ b/configs/shenzhou/src/up_ili93xx.c @@ -832,15 +832,16 @@ static void stm32_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels { int i, j; - syslog("\n%s:\n", msg); + syslog(LOG_DEBUG, "\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - syslog(" "); + syslog(LOG_DEBUG, " "); for (j = 0; j < 16; j++) { - syslog(" %04x", *run++); + syslog(LOG_DEBUG, " %04x", *run++); } + up_putc('\n'); } } diff --git a/configs/stm3210e-eval/src/up_lcd.c b/configs/stm3210e-eval/src/up_lcd.c index cf446a11fa..ffa32c415f 100644 --- a/configs/stm3210e-eval/src/up_lcd.c +++ b/configs/stm3210e-eval/src/up_lcd.c @@ -703,14 +703,14 @@ static void stm3210e_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix { int i, j; - syslog("\n%s:\n", msg); + syslog(LOG_DEBUG, "\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - syslog(" "); + syslog(LOG_DEBUG, " "); for (j = 0; j < 16; j++) { - syslog(" %04x", *run++); + syslog(LOG_DEBUG, " %04x", *run++); } up_putc('\n'); } diff --git a/configs/stm3210e-eval/src/up_pmbuttons.c b/configs/stm3210e-eval/src/up_pmbuttons.c index d82edfbb8a..4e35498f10 100644 --- a/configs/stm3210e-eval/src/up_pmbuttons.c +++ b/configs/stm3210e-eval/src/up_pmbuttons.c @@ -308,7 +308,7 @@ void up_pmbuttons(void) if (oldhandler != NULL) { - lowsyslog("WARNING: oldhandler:%p is not NULL! " + lowsyslog(LOG_WARNING, "WARNING: oldhandler:%p is not NULL! " "Button events may be lost or aliased!\n", oldhandler); } diff --git a/configs/stm3240g-eval/src/up_lcd.c b/configs/stm3240g-eval/src/up_lcd.c index 5aaa60a47f..af6d557458 100644 --- a/configs/stm3240g-eval/src/up_lcd.c +++ b/configs/stm3240g-eval/src/up_lcd.c @@ -549,14 +549,14 @@ static void stm3240g_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix { int i, j; - syslog("\n%s:\n", msg); + syslog(LOG_DEBUG, "\n%s:\n", msg); for (i = 0; i < npixels; i += 16) { up_putc(' '); - syslog(" "); + syslog(LOG_DEBUG, " "); for (j = 0; j < 16; j++) { - syslog(" %04x", *run++); + syslog(LOG_DEBUG, " %04x", *run++); } up_putc('\n'); } diff --git a/configs/stm32f4discovery/src/stm32_pmbuttons.c b/configs/stm32f4discovery/src/stm32_pmbuttons.c index d18cb6a1ba..b060e9a55b 100644 --- a/configs/stm32f4discovery/src/stm32_pmbuttons.c +++ b/configs/stm32f4discovery/src/stm32_pmbuttons.c @@ -138,9 +138,9 @@ void stm32_pm_buttons(void) if (oldhandler != NULL) { - lowsyslog("WARNING: oldhandler:%p is not NULL! " - "Button events may be lost or aliased!\n", - oldhandler); + lowsyslog(LOG_WARNING, "WARNING: oldhandler:%p is not NULL! " + "Button events may be lost or aliased!\n", + oldhandler); } #endif } diff --git a/configs/vsn/src/vsn.h b/configs/vsn/src/vsn.h index e84f0acb49..79195e2bcc 100644 --- a/configs/vsn/src/vsn.h +++ b/configs/vsn/src/vsn.h @@ -169,25 +169,6 @@ /* Expansion Connector */ -/************************************************************************************ - * Debugging - ************************************************************************************/ - -#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 data ************************************************************************************/