Update everything under nuttx/drivers to use the corrected syslog interfaces

This commit is contained in:
Gregory Nutt
2014-10-08 10:18:58 -06:00
parent d55ab6a0f5
commit d7d759f7a7
14 changed files with 198 additions and 167 deletions
+24 -2
View File
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
#include <errno.h>
#include <debug.h>
@@ -88,6 +89,26 @@ static usbtrace_idset_t g_maskedidset = CONFIG_USBDEV_TRACE_INITIALIDSET;
* Private Functions
****************************************************************************/
/****************************************************************************
* Name: usbtrace_syslog
****************************************************************************/
#if !defined(CONFIG_USBDEV_TRACE) && \
(defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
static int usbtrace_syslog(const char *fmt, ...)
{
va_list ap;
int ret;
/* Let lowvsyslog do the real work */
va_start(ap, fmt);
ret = lowvsyslog(LOG_INFO, fmt, ap);
va_end(ap);
return ret;
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -110,7 +131,8 @@ static usbtrace_idset_t g_maskedidset = CONFIG_USBDEV_TRACE_INITIALIDSET;
*
*******************************************************************************/
#if defined(CONFIG_USBDEV_TRACE) || (defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
#if defined(CONFIG_USBDEV_TRACE) || \
(defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_USB))
usbtrace_idset_t usbtrace_enable(usbtrace_idset_t idset)
{
irqstate_t flags;
@@ -170,7 +192,7 @@ void usbtrace(uint16_t event, uint16_t value)
#else
/* Just print the data using lowsyslog */
usbtrace_trprintf((trprintf_t)lowsyslog, event, value);
usbtrace_trprintf(usbtrace_syslog, event, value);
#endif
}
-24
View File
@@ -204,30 +204,6 @@
# define CONFIG_USBMSC_SCSI_STACKSIZE 2048
#endif
/* Debug -- must be consistent with include/debug.h */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# ifdef CONFIG_ARCH_LOWPUTC
# define dbgprintf(format, ...) lowsyslog(format, ##__VA_ARGS__)
# else
# define dbgprintf(format, ...) syslog(format, ##__VA_ARGS__)
# endif
# else
# define dbgprintf(x...)
# endif
#else
# ifdef CONFIG_DEBUG
# ifdef CONFIG_ARCH_LOWPUTC
# define dbgprintf lowsyslog
# else
# define dbgprintf syslog
# endif
# else
# define dbgprintf (void)
# endif
#endif
/* Packet and request buffer sizes */
#ifndef CONFIG_USBMSC_EP0MAXPACKET
+4 -3
View File
@@ -199,12 +199,13 @@ static void usbmsc_dumpdata(const char *msg, const uint8_t *buf, int buflen)
{
int i;
dbgprintf("%s:", msg);
lowsyslog(LOG_DEBUG, "%s:", msg);
for (i = 0; i < buflen; i++)
{
dbgprintf(" %02x", buf[i]);
lowsyslog(LOG_DEBUG, " %02x", buf[i]);
}
dbgprintf("\n");
lowsyslog(LOG_DEBUG, "\n");
}
#endif