summaryrefslogtreecommitdiff
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
parentcadc17b6922526f0c97d1fa0fa32639f240639cb (diff)
debug: trace current instruction pointer
-rw-r--r--can.c1
-rw-r--r--lightctrl.c5
-rw-r--r--tick.c1
3 files changed, 7 insertions, 0 deletions
diff --git a/can.c b/can.c
index 370cfd6..739ae68 100644
--- a/can.c
+++ b/can.c
@@ -203,6 +203,7 @@ ISR(INT0_vect)
#ifdef HAVE_TICK
uart_puttick();
#endif
+// dbg_dump_ret();
uart_puts("can: irqh<");
spi_ss(0);
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>
diff --git a/tick.c b/tick.c
index 76ebcc0..a99b303 100644
--- a/tick.c
+++ b/tick.c
@@ -8,6 +8,7 @@ static union {
ISR(TIMER1_COMPA_vect)
{
systick.u32++;
+// dbg_dump_ret();
}
static void uart_puttick(void)