diff options
| author | David Lamparter <equinox@diac24.net> | 2013-03-10 04:43:22 +0100 | 
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2013-03-10 04:43:22 +0100 | 
| commit | 2e6b83de5ee42b708e2bb4de81bca0e9bcc5f91e (patch) | |
| tree | a1cbd961e671215d2ac25e0d1c35ef2b5aa80ed1 | |
| parent | cadc17b6922526f0c97d1fa0fa32639f240639cb (diff) | |
debug: trace current instruction pointer
| -rw-r--r-- | can.c | 1 | ||||
| -rw-r--r-- | lightctrl.c | 5 | ||||
| -rw-r--r-- | tick.c | 1 | 
3 files changed, 7 insertions, 0 deletions
@@ -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> @@ -8,6 +8,7 @@ static union {  ISR(TIMER1_COMPA_vect)  {  	systick.u32++; +//	dbg_dump_ret();  }  static void uart_puttick(void)  | 
