Remaining files under nuttx/configs changed to use the corrected syslog interfaces

This commit is contained in:
Gregory Nutt
2014-10-08 15:32:00 -06:00
parent 2199c2b1fc
commit 2b77c9ceb9
11 changed files with 57 additions and 92 deletions
+5 -3
View File
@@ -92,7 +92,7 @@ int usbmsc_archinitialize(void)
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE); pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
if (!pbuffer) 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); BUFFER_SIZE);
return -ENOMEM; return -ENOMEM;
} }
@@ -106,7 +106,8 @@ int usbmsc_archinitialize(void)
true); true);
if (ret < 0) 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); g_source, -ret);
kmm_free(pbuffer); kmm_free(pbuffer);
return ret; return ret;
@@ -117,7 +118,8 @@ int usbmsc_archinitialize(void)
ret = mkfatfs(g_source, &g_fmt); ret = mkfatfs(g_source, &g_fmt);
if (ret < 0) 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); g_source);
/* kmm_free(pbuffer); -- RAM disk is registered */ /* kmm_free(pbuffer); -- RAM disk is registered */
return ret; return ret;
+8 -24
View File
@@ -83,22 +83,6 @@
#define LED_BLUE 0 #define LED_BLUE 0
#define LED_SAFETY 2 #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 * Private Data
****************************************************************************/ ****************************************************************************/
@@ -138,7 +122,7 @@ static void dma_alloc_init(void)
if (dma_allocator == NULL) if (dma_allocator == NULL)
{ {
message("[boot] DMA allocator setup FAILED"); syslog(LOG_INFO, "[boot] DMA allocator setup FAILED");
} }
} }
#else #else
@@ -239,7 +223,7 @@ int nsh_archinitialize(void)
spi1 = up_spiinitialize(1); spi1 = up_spiinitialize(1);
if (!spi1) 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); board_led_on(LED_AMBER);
return -ENODEV; return -ENODEV;
} }
@@ -255,14 +239,14 @@ int nsh_archinitialize(void)
SPI_SELECT(spi1, PX4_SPIDEV_MPU, false); SPI_SELECT(spi1, PX4_SPIDEV_MPU, false);
up_udelay(20); 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 */ /* Get the SPI port for the FRAM */
spi2 = up_spiinitialize(2); spi2 = up_spiinitialize(2);
if (!spi2) 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); board_led_on(LED_AMBER);
return -ENODEV; return -ENODEV;
} }
@@ -278,7 +262,7 @@ int nsh_archinitialize(void)
SPI_SETMODE(spi2, SPIDEV_MODE3); SPI_SETMODE(spi2, SPIDEV_MODE3);
SPI_SELECT(spi2, SPIDEV_FLASH, false); 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 #ifdef CONFIG_MMCSD
/* First, get an instance of the SDIO interface */ /* First, get an instance of the SDIO interface */
@@ -286,7 +270,7 @@ int nsh_archinitialize(void)
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
if (!sdio) if (!sdio)
{ {
message("[boot] Failed to initialize SDIO slot %d\n", syslog(LOG_ERR, "[boot] Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV; return -ENODEV;
} }
@@ -296,7 +280,7 @@ int nsh_archinitialize(void)
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
if (ret != OK) 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; return ret;
} }
@@ -306,7 +290,7 @@ int nsh_archinitialize(void)
sdio_mediachange(sdio, true); sdio_mediachange(sdio, true);
message("[boot] Initialized SDIO\n"); syslog(LOG_INFO, "[boot] Initialized SDIO\n");
#endif #endif
return OK; return OK;
+3 -3
View File
@@ -577,14 +577,14 @@ static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels)
{ {
int i, j; int i, j;
syslog("\n%s:\n", msg); syslog(LOG_DEBUG, "\n%s:\n", msg);
for (i = 0; i < npixels; i += 16) for (i = 0; i < npixels; i += 16)
{ {
up_putc(' '); up_putc(' ');
syslog(" "); syslog(LOG_DEBUG, " ");
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
syslog(" %04x", *run++); syslog(LOG_DEBUG, " %04x", *run++);
} }
up_putc('\n'); up_putc('\n');
} }
+4 -3
View File
@@ -608,15 +608,16 @@ static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels)
{ {
int i, j; int i, j;
syslog("\n%s:\n", msg); syslog(LOG_DEBUG, "\n%s:\n", msg);
for (i = 0; i < npixels; i += 16) for (i = 0; i < npixels; i += 16)
{ {
up_putc(' '); up_putc(' ');
syslog(" "); syslog(LOG_DEBUG, " ");
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
syslog(" %04x", *run++); syslog(LOG_DEBUG, " %04x", *run++);
} }
up_putc('\n'); up_putc('\n');
} }
} }
+16 -20
View File
@@ -70,13 +70,9 @@
/* Debug ********************************************************************/ /* Debug ********************************************************************/
#ifdef CONFIG_BOARD_INITIALIZE #ifdef CONFIG_BOARD_INITIALIZE
# define message lldbg # define SYSLOG lldbg
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define SYSLOG dbg
# define message(...) syslog(__VA_ARGS__)
# else
# define message syslog
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -105,7 +101,7 @@ int sam_bringup(void)
ret = sam_nand_automount(NAND_MINOR); ret = sam_nand_automount(NAND_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_nand_automount failed: %d\n", ret); SYSLOG("ERROR: sam_nand_automount failed: %d\n", ret);
} }
#endif #endif
@@ -115,7 +111,7 @@ int sam_bringup(void)
ret = sam_at25_automount(AT25_MINOR); ret = sam_at25_automount(AT25_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_at25_automount failed: %d\n", ret); SYSLOG("ERROR: sam_at25_automount failed: %d\n", ret);
} }
#endif #endif
@@ -126,7 +122,7 @@ int sam_bringup(void)
ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR); ret = sam_hsmci_initialize(HSMCI0_SLOTNO, HSMCI0_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", SYSLOG("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
HSMCI0_SLOTNO, HSMCI0_MINOR, ret); HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
} }
@@ -143,7 +139,7 @@ int sam_bringup(void)
if (ret < 0) if (ret < 0)
{ {
message("ERROR: Failed to mount %s: %d\n", SYSLOG("ERROR: Failed to mount %s: %d\n",
CONFIG_SAMA5D4EK_HSMCI0_MOUNT_MOUNTPOINT, errno); CONFIG_SAMA5D4EK_HSMCI0_MOUNT_MOUNTPOINT, errno);
} }
} }
@@ -156,7 +152,7 @@ int sam_bringup(void)
ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR); ret = sam_hsmci_initialize(HSMCI1_SLOTNO, HSMCI1_MINOR);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n", SYSLOG("ERROR: sam_hsmci_initialize(%d,%d) failed: %d\n",
HSMCI1_SLOTNO, HSMCI1_MINOR, ret); HSMCI1_SLOTNO, HSMCI1_MINOR, ret);
} }
@@ -173,7 +169,7 @@ int sam_bringup(void)
if (ret < 0) if (ret < 0)
{ {
message("ERROR: Failed to mount %s: %d\n", SYSLOG("ERROR: Failed to mount %s: %d\n",
CONFIG_SAMA5D4EK_HSMCI1_MOUNT_MOUNTPOINT, errno); CONFIG_SAMA5D4EK_HSMCI1_MOUNT_MOUNTPOINT, errno);
} }
} }
@@ -195,7 +191,7 @@ int sam_bringup(void)
CONFIG_SAMA5D4EK_ROMFS_ROMDISK_SECTSIZE); CONFIG_SAMA5D4EK_ROMFS_ROMDISK_SECTSIZE);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: romdisk_register failed: %d\n", -ret); SYSLOG("ERROR: romdisk_register failed: %d\n", -ret);
} }
else else
{ {
@@ -206,7 +202,7 @@ int sam_bringup(void)
"romfs", MS_RDONLY, NULL); "romfs", MS_RDONLY, NULL);
if (ret < 0) if (ret < 0)
{ {
message("ERROR: mount(%s,%s,romfs) failed: %d\n", SYSLOG("ERROR: mount(%s,%s,romfs) failed: %d\n",
CONFIG_SAMA5D4EK_ROMFS_ROMDISK_DEVNAME, CONFIG_SAMA5D4EK_ROMFS_ROMDISK_DEVNAME,
CONFIG_SAMA5D4EK_ROMFS_MOUNT_MOUNTPOINT, errno); CONFIG_SAMA5D4EK_ROMFS_MOUNT_MOUNTPOINT, errno);
} }
@@ -221,7 +217,7 @@ int sam_bringup(void)
ret = sam_usbhost_initialize(); ret = sam_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
message("ERROR: Failed to initialize USB host: %d\n", ret); SYSLOG("ERROR: Failed to initialize USB host: %d\n", ret);
} }
#endif #endif
@@ -231,7 +227,7 @@ int sam_bringup(void)
ret = usbmonitor_start(0, NULL); ret = usbmonitor_start(0, NULL);
if (ret != OK) 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 #endif
@@ -241,7 +237,7 @@ int sam_bringup(void)
ret = sam_wm8904_initialize(0); ret = sam_wm8904_initialize(0);
if (ret != OK) if (ret != OK)
{ {
message("ERROR: Failed to initialize WM8904 audio: %d\n", ret); SYSLOG("ERROR: Failed to initialize WM8904 audio: %d\n", ret);
} }
#endif #endif
@@ -251,18 +247,18 @@ int sam_bringup(void)
ret = sam_audio_null_initialize(0); ret = sam_audio_null_initialize(0);
if (ret != OK) 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 #endif
#ifdef HAVE_ELF #ifdef HAVE_ELF
/* Initialize the ELF binary loader */ /* Initialize the ELF binary loader */
message("Initializing the ELF binary loader\n"); SYSLOG("Initializing the ELF binary loader\n");
ret = elf_initialize(); ret = elf_initialize();
if (ret < 0) 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 #endif
+4 -3
View File
@@ -832,15 +832,16 @@ static void stm32_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels
{ {
int i, j; int i, j;
syslog("\n%s:\n", msg); syslog(LOG_DEBUG, "\n%s:\n", msg);
for (i = 0; i < npixels; i += 16) for (i = 0; i < npixels; i += 16)
{ {
up_putc(' '); up_putc(' ');
syslog(" "); syslog(LOG_DEBUG, " ");
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
syslog(" %04x", *run++); syslog(LOG_DEBUG, " %04x", *run++);
} }
up_putc('\n'); up_putc('\n');
} }
} }
+3 -3
View File
@@ -703,14 +703,14 @@ static void stm3210e_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix
{ {
int i, j; int i, j;
syslog("\n%s:\n", msg); syslog(LOG_DEBUG, "\n%s:\n", msg);
for (i = 0; i < npixels; i += 16) for (i = 0; i < npixels; i += 16)
{ {
up_putc(' '); up_putc(' ');
syslog(" "); syslog(LOG_DEBUG, " ");
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
syslog(" %04x", *run++); syslog(LOG_DEBUG, " %04x", *run++);
} }
up_putc('\n'); up_putc('\n');
} }
+1 -1
View File
@@ -308,7 +308,7 @@ void up_pmbuttons(void)
if (oldhandler != NULL) 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", "Button events may be lost or aliased!\n",
oldhandler); oldhandler);
} }
+3 -3
View File
@@ -549,14 +549,14 @@ static void stm3240g_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npix
{ {
int i, j; int i, j;
syslog("\n%s:\n", msg); syslog(LOG_DEBUG, "\n%s:\n", msg);
for (i = 0; i < npixels; i += 16) for (i = 0; i < npixels; i += 16)
{ {
up_putc(' '); up_putc(' ');
syslog(" "); syslog(LOG_DEBUG, " ");
for (j = 0; j < 16; j++) for (j = 0; j < 16; j++)
{ {
syslog(" %04x", *run++); syslog(LOG_DEBUG, " %04x", *run++);
} }
up_putc('\n'); up_putc('\n');
} }
@@ -138,7 +138,7 @@ void stm32_pm_buttons(void)
if (oldhandler != NULL) 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", "Button events may be lost or aliased!\n",
oldhandler); oldhandler);
} }
-19
View File
@@ -169,25 +169,6 @@
/* Expansion Connector */ /* 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 * Public data
************************************************************************************/ ************************************************************************************/