summaryrefslogtreecommitdiffstats
path: root/firmware/debug.c
diff options
context:
space:
mode:
authorStuart Martin <mister_wavey@rockbox.org>2002-04-30 19:43:54 +0000
committerStuart Martin <mister_wavey@rockbox.org>2002-04-30 19:43:54 +0000
commitf2c12559226df5303c16026c3be42fc0a1a82900 (patch)
treea9480b89c1c567ae0acccb5c3d907d1aae116549 /firmware/debug.c
parentdb64fa259b9050c7eacc822a18a697e43176cadf (diff)
downloadrockbox-f2c12559226df5303c16026c3be42fc0a1a82900.tar.gz
rockbox-f2c12559226df5303c16026c3be42fc0a1a82900.tar.bz2
rockbox-f2c12559226df5303c16026c3be42fc0a1a82900.zip
added #ifdef CRT_DISPLAY to provide a printf version of debug()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@345 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/debug.c')
-rw-r--r--firmware/debug.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/debug.c b/firmware/debug.c
index 5cd1f15a38..d2186049aa 100644
--- a/firmware/debug.c
+++ b/firmware/debug.c
@@ -20,10 +20,13 @@
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
+#include "config.h"
char debugmembuf[100];
char debugbuf[200];
+#ifndef CRT_DISPLAY /* allow non archos platforms to display output */
+
static int debug_tx_ready(void)
{
return (SSR1 & SCI_TDRE);
@@ -181,3 +184,22 @@ void debugf(char *fmt, ...)
va_end(ap);
debug(debugmembuf);
}
+
+#else
+
+void debug( const char *message )
+{
+ printf( message );
+}
+
+void debugf(char *fmt, ...)
+{
+ va_list ap;
+
+ va_start( ap, fmt );
+ vsprintf( debugmembuf, fmt, ap );
+ va_end( ap );
+ printf( debugmembuf );
+}
+#endif
+