Add syslog.h; rename lib_rawprintf() to syslog()

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5578 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-28 21:55:16 +00:00
parent 433dae7422
commit 79ccfa4ae6
180 changed files with 677 additions and 520 deletions
+3 -3
View File
@@ -495,14 +495,14 @@ static void mio283qt2_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npi
{
int i, j;
lib_rawprintf("\n%s:\n", msg);
syslog("\n%s:\n", msg);
for (i = 0; i < npixels; i += 16)
{
up_putc(' ');
lib_rawprintf(" ");
syslog(" ");
for (j = 0; j < 16; j++)
{
lib_rawprintf(" %04x", *run++);
syslog(" %04x", *run++);
}
up_putc('\n');
}
+3 -3
View File
@@ -497,14 +497,14 @@ static void ssd1289_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixe
{
int i, j;
lib_rawprintf("\n%s:\n", msg);
syslog("\n%s:\n", msg);
for (i = 0; i < npixels; i += 16)
{
up_putc(' ');
lib_rawprintf(" ");
syslog(" ");
for (j = 0; j < 16; j++)
{
lib_rawprintf(" %04x", *run++);
syslog(" %04x", *run++);
}
up_putc('\n');
}
+2 -2
View File
@@ -56,9 +56,9 @@
/* This needs to match the logic in include/debug.h */
#ifdef CONFIG_CPP_HAVE_VARARGS
# define message(format, arg...) lib_rawprintf(format, ##arg)
# define message(format, arg...) syslog(format, ##arg)
#else
# define message lib_rawprintf
# define message syslog
#endif
/****************************************************************************
+48 -48
View File
@@ -179,10 +179,10 @@
/* Debug ********************************************************************/
#ifdef CONFIG_ENC28J60_REGDEBUG
# define enc_wrdump(a,v) lib_lowprintf("ENC28J60: %02x<-%02x\n", a, v);
# define enc_rddump(a,v) lib_lowprintf("ENC28J60: %02x->%02x\n", a, v);
# define enc_cmddump(c) lib_lowprintf("ENC28J60: CMD: %02x\n", c);
# define enc_bmdump(c,b,s) lib_lowprintf("ENC28J60: CMD: %02x buffer: %p length: %d\n", c,b,s);
# define enc_wrdump(a,v) lowsyslog("ENC28J60: %02x<-%02x\n", a, v);
# define enc_rddump(a,v) lowsyslog("ENC28J60: %02x->%02x\n", a, v);
# define enc_cmddump(c) lowsyslog("ENC28J60: CMD: %02x\n", c);
# define enc_bmdump(c,b,s) lowsyslog("ENC28J60: CMD: %02x buffer: %p length: %d\n", c,b,s);
#else
# define enc_wrdump(a,v)
# define enc_rddump(a,v)
@@ -773,56 +773,56 @@ static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
#if 0 /* Sometimes useful */
static void enc_rxdump(FAR struct enc_driver_s *priv)
{
lib_lowprintf("Rx Registers:\n");
lib_lowprintf(" EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
lib_lowprintf(" ESTAT: %02x ECON1: %02x ECON2: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1),
enc_rdgreg(priv, ENC_ECON2));
lib_lowprintf(" ERXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL));
lib_lowprintf(" ERXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL));
lib_lowprintf(" ERXRDPT: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL));
lib_lowprintf(" ERXFCON: %02x EPKTCNT: %02x\n",
enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT));
lib_lowprintf(" MACON1: %02x MACON3: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3));
lib_lowprintf(" MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
lib_lowprintf(" MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n",
enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2),
enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4),
enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6));
lowsyslog("Rx Registers:\n");
lowsyslog(" EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
lowsyslog(" ESTAT: %02x ECON1: %02x ECON2: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1),
enc_rdgreg(priv, ENC_ECON2));
lowsyslog(" ERXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL));
lowsyslog(" ERXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL));
lowsyslog(" ERXRDPT: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL));
lowsyslog(" ERXFCON: %02x EPKTCNT: %02x\n",
enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT));
lowsyslog(" MACON1: %02x MACON3: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3));
lowsyslog(" MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
lowsyslog(" MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n",
enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2),
enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4),
enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6));
}
#endif
#if 0 /* Sometimes useful */
static void enc_txdump(FAR struct enc_driver_s *priv)
{
lib_lowprintf("Tx Registers:\n");
lib_lowprintf(" EIE: %02x EIR: %02x ESTAT: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR),);
lib_lowprintf(" ESTAT: %02x ECON1: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1));
lib_lowprintf(" ETXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL));
lib_lowprintf(" ETXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL));
lib_lowprintf(" MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lib_lowprintf(" MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lib_lowprintf(" MABBIPG: %02x MAIPG %02x %02x\n",
enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH),
enc_rdbreg(priv, ENC_MAIPGL));
lib_lowprintf(" MACLCON1: %02x MACLCON2: %02x\n",
enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2));
lib_lowprintf(" MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
lowsyslog("Tx Registers:\n");
lowsyslog(" EIE: %02x EIR: %02x ESTAT: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR),);
lowsyslog(" ESTAT: %02x ECON1: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1));
lowsyslog(" ETXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL));
lowsyslog(" ETXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL));
lowsyslog(" MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lowsyslog(" MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lowsyslog(" MABBIPG: %02x MAIPG %02x %02x\n",
enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH),
enc_rdbreg(priv, ENC_MAIPGL));
lowsyslog(" MACLCON1: %02x MACLCON2: %02x\n",
enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2));
lowsyslog(" MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
}
#endif
+3 -3
View File
@@ -726,10 +726,10 @@ int ramlog_sysloginit(void)
*
* Description:
* This is the low-level system logging interface. The debugging/syslogging
* interfaces are lib_rawprintf() and lib_lowprinf(). The difference is
* the lib_rawprintf() writes to fd=1 (stdout) and lib_lowprintf() uses
* interfaces are syslog() and lowsyslog(). The difference is that
* the syslog() internface writes to fd=1 (stdout) whereas lowsyslog() uses
* a lower level interface that works from interrupt handlers. This
* function is a a low-level interface used to implement lib_lowprintf()
* function is a a low-level interface used to implement lowsyslog()
* when CONFIG_RAMLOG_SYSLOG=y and CONFIG_SYSLOG=y
*
****************************************************************************/
+2 -2
View File
@@ -168,9 +168,9 @@ void usbtrace(uint16_t event, uint16_t value)
}
}
#else
/* Just print the data using lib_lowprintf */
/* Just print the data using lowsyslog */
usbtrace_trprintf((trprintf_t)lib_lowprintf, event, value);
usbtrace_trprintf((trprintf_t)lowsyslog, event, value);
#endif
}
irqrestore(flags);
+4 -4
View File
@@ -199,9 +199,9 @@
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# ifdef CONFIG_ARCH_LOWPUTC
# define dbgprintf(format, arg...) lib_lowprintf(format, ##arg)
# define dbgprintf(format, arg...) lowsyslog(format, ##arg)
# else
# define dbgprintf(format, arg...) lib_rawprintf(format, ##arg)
# define dbgprintf(format, arg...) syslog(format, ##arg)
# endif
# else
# define dbgprintf(x...)
@@ -209,9 +209,9 @@
#else
# ifdef CONFIG_DEBUG
# ifdef CONFIG_ARCH_LOWPUTC
# define dbgprintf lib_lowprintf
# define dbgprintf lowsyslog
# else
# define dbgprintf lib_rawprintf
# define dbgprintf syslog
# endif
# else
# define dbgprintf (void)