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

View File

@ -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;

View File

@ -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;

View File

@ -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');
}

View File

@ -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');
}
}

View File

@ -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

View File

@ -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');
}
}

View File

@ -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');
}

View File

@ -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);
}

View File

@ -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');
}

View File

@ -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
}

View File

@ -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
************************************************************************************/