From 2d9b8a83a2d9f495199033e43f519d26f27938fe Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 6 Apr 2009 11:31:49 -0700 Subject: Add support for a serial-connected custom debug dongle This uses the cc1111 board as a custom debug dongle with faster methods for communicating with the debug target. --- lib/ccdbg-debug.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/ccdbg-debug.c') diff --git a/lib/ccdbg-debug.c b/lib/ccdbg-debug.c index 847361c7..6eb4e0c5 100644 --- a/lib/ccdbg-debug.c +++ b/lib/ccdbg-debug.c @@ -34,11 +34,20 @@ ccdbg_clear_debug(int level) ccdbg_level &= ~level; } +static int initialized; + void ccdbg_debug(int level, char *format, ...) { va_list ap; + if (!initialized) { + char *level; + initialized = 1; + level = getenv("CCDEBUG"); + if (level) + ccdbg_level |= strtoul(level, NULL, 0); + } if (ccdbg_level & level) { va_start(ap, format); vprintf(format, ap); -- cgit v1.2.3