From 3424102f622c475f8286206bda7b3cffc1d21d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sat, 17 Jan 2015 08:03:50 +0000 Subject: [PATCH] added code to halt machine after a fatal error --- BaS_gcc/sys/fault_vectors.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BaS_gcc/sys/fault_vectors.c b/BaS_gcc/sys/fault_vectors.c index 702cbdd..8e8c552 100644 --- a/BaS_gcc/sys/fault_vectors.c +++ b/BaS_gcc/sys/fault_vectors.c @@ -158,6 +158,14 @@ void fault_handler(uint32_t pc, uint32_t format_status) } xprintf(")\r\n"); 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)