diff options
Diffstat (limited to 'firmware/src/simtrace')
-rw-r--r-- | firmware/src/simtrace/main_simtrace.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/src/simtrace/main_simtrace.c b/firmware/src/simtrace/main_simtrace.c index b3f2665..b84525f 100644 --- a/firmware/src/simtrace/main_simtrace.c +++ b/firmware/src/simtrace/main_simtrace.c @@ -136,8 +136,24 @@ static int simtrace_usb_in(struct req_ctx *rctx) } } +void custom_spurious_handler(unsigned previous_pc) +{ + char dbg_buf[100]; + sprintf(dbg_buf, "SPURRIOUS IRQ [Old PC = %08X]\n\r", previous_pc); + AT91F_DBGU_Frame(dbg_buf); +} + +void custom_spurious_entry(void) +{ + register unsigned *previous_pc asm("r0"); + asm("ADD R1, SP, #16; LDR R0, [R1]"); + custom_spurious_handler(previous_pc); +} + void _init_func(void) { + AT91C_BASE_AIC->AIC_SPU = (int)custom_spurious_entry; + /* low-level hardware initialization */ pio_irq_init(); iso_uart_init(); |