added code to halt machine after a fatal error

This commit is contained in:
Markus Fröschle
2015-01-17 08:03:50 +00:00
parent 56a0731ed1
commit ee53b7a330

View File

@@ -158,6 +158,14 @@ void fault_handler(uint32_t pc, uint32_t format_status)
} }
xprintf(")\r\n"); xprintf(")\r\n");
xprintf("sr=%4x\r\n", sr); xprintf("sr=%4x\r\n", sr);
__asm__ __volatile__(
" move.w 0x2700,d0 \r\n" // disable interrupts
" move.w d0,sr \r\n"
" halt \r\n" // stop processor
: /* no output */
: /* no input */
: "memory");
} }
void __attribute__((interrupt)) handler(void) void __attribute__((interrupt)) handler(void)