summaryrefslogtreecommitdiff
path: root/firmware/src/dfu/dbgu.h
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-20 07:06:55 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-20 07:06:55 +0000
commit18943155145422e475c451317fe84388829a925b (patch)
tree177d90cd6edac0011c60f47849a6673a08f1f421 /firmware/src/dfu/dbgu.h
parent8fba1712cbfd11781f6bb9e717f70bcb6ef5a6c0 (diff)
Add DFU debugging capabilities (makes DFU compile if DEBUG=1)
git-svn-id: https://svn.openpcd.org:2342/trunk@203 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/dfu/dbgu.h')
-rw-r--r--firmware/src/dfu/dbgu.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/firmware/src/dfu/dbgu.h b/firmware/src/dfu/dbgu.h
new file mode 100644
index 0000000..9f4f002
--- /dev/null
+++ b/firmware/src/dfu/dbgu.h
@@ -0,0 +1,27 @@
+#ifndef dbgu_h
+#define dbgu_h
+
+#define AT91C_DBGU_BAUD 115200
+
+#define DEBUGP(x, args ...) debugp(x, ## args)
+#define DEBUGPCR(x, args ...) DEBUGP(x "\r\n", ## args)
+#define DEBUGPCRF(x, args ...) DEBUGPCR("%s(%d): " x, __FUNCTION__, __LINE__, ## args)
+
+#ifdef DEBUG
+extern void debugp(const char *format, ...);
+extern const char *hexdump(const void *data, unsigned int len);
+extern void AT91F_DBGU_Init(void);
+extern void AT91F_DBGU_Printk(char *buffer);
+extern void AT91F_DBGU_Frame(char *buffer);
+extern int AT91F_DBGU_Get(char *val);
+#else
+#define debugp(x, args ...)
+#define hexdump(x, args ...)
+#define AT91F_DBGU_Get(x, args ...) 0;
+#define AT91F_DBGU_Frame(x)
+#define AT91F_DBGU_Printk(x)
+#define AT91F_DBGU_Init()
+#define AT91F_DBGU_Ready()
+#endif
+
+#endif /* dbgu_h */
personal git repositories of Harald Welte. Your mileage may vary