diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-12 23:54:26 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-12 23:54:26 +0000 |
commit | c2079e368c183a100c549671925b66d6b993c8c2 (patch) | |
tree | 6e9e40c95947255b743c4a08926a407360d2a19c /nuttx/lib/stdio | |
parent | a8d12f6d37d46732011e008ac8252c4a3183e182 (diff) | |
download | px4-nuttx-c2079e368c183a100c549671925b66d6b993c8c2.tar.gz px4-nuttx-c2079e368c183a100c549671925b66d6b993c8c2.tar.bz2 px4-nuttx-c2079e368c183a100c549671925b66d6b993c8c2.zip |
Add interface to enabled/disable debug output
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4386 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/stdio')
-rw-r--r-- | nuttx/lib/stdio/lib_lowprintf.c | 13 | ||||
-rw-r--r-- | nuttx/lib/stdio/lib_rawprintf.c | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/nuttx/lib/stdio/lib_lowprintf.c b/nuttx/lib/stdio/lib_lowprintf.c index e27a5021b..50a6568fb 100644 --- a/nuttx/lib/stdio/lib_lowprintf.c +++ b/nuttx/lib/stdio/lib_lowprintf.c @@ -111,9 +111,16 @@ int lib_lowprintf(const char *fmt, ...) va_list ap; int ret; - va_start(ap, fmt); - ret= lib_lowvprintf(fmt, ap); - va_end(ap); +#ifdef CONFIG_DEBUG_ENABLE + ret = 0; + if (g_dbgenable) +#endif + { + va_start(ap, fmt); + ret = lib_lowvprintf(fmt, ap); + va_end(ap); + } + return ret; } diff --git a/nuttx/lib/stdio/lib_rawprintf.c b/nuttx/lib/stdio/lib_rawprintf.c index a28e6b695..19dfa895e 100644 --- a/nuttx/lib/stdio/lib_rawprintf.c +++ b/nuttx/lib/stdio/lib_rawprintf.c @@ -137,8 +137,15 @@ int lib_rawprintf(const char *fmt, ...) va_list ap; int ret; - va_start(ap, fmt); - ret= lib_rawvprintf(fmt, ap); - va_end(ap); +#ifdef CONFIG_DEBUG_ENABLE + ret = 0; + if (g_dbgenable) +#endif + { + va_start(ap, fmt); + ret = lib_rawvprintf(fmt, ap); + va_end(ap); + } + return ret; } |