summaryrefslogtreecommitdiff
path: root/lightctrl.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-03-10 04:43:22 +0100
committerDavid Lamparter <equinox@diac24.net>2013-03-10 04:43:22 +0100
commit2e6b83de5ee42b708e2bb4de81bca0e9bcc5f91e (patch)
treea1cbd961e671215d2ac25e0d1c35ef2b5aa80ed1 /lightctrl.c
parentcadc17b6922526f0c97d1fa0fa32639f240639cb (diff)
debug: trace current instruction pointer
Diffstat (limited to 'lightctrl.c')
-rw-r--r--lightctrl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lightctrl.c b/lightctrl.c
index bc5e67e..66f726a 100644
--- a/lightctrl.c
+++ b/lightctrl.c
@@ -1,3 +1,8 @@
+#define _dbg_dump_ret()
+#define dbg_dump_ret() do { \
+ union { uint16_t u; void *p; } ret = { .p = __builtin_return_address(0) }; \
+ _uart_putch('#'); uart_puthex16((ret.u & 0xfff) << 1); _uart_putch('\n'); } while (0)
+
#define F_CPU 8000000
#include <stdint.h>
#include <stdbool.h>