From: arighi Date: Wed, 31 Mar 2010 14:41:55 +0000 (+0000) Subject: lm3s1968: log an error and halt forever in case of unhandled IRQs. X-Git-Tag: 2.5.0~552 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=34a467fa89d01c8248fabc52bc5a4f5edf67570a;p=bertos.git lm3s1968: log an error and halt forever in case of unhandled IRQs. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3356 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/irq_lm3s.c b/bertos/cpu/cortex-m3/drv/irq_lm3s.c index c1df5019..2ff83575 100644 --- a/bertos/cpu/cortex-m3/drv/irq_lm3s.c +++ b/bertos/cpu/cortex-m3/drv/irq_lm3s.c @@ -35,7 +35,8 @@ * \author Andrea Righi */ -#include +#include /* ASSERT() */ +#include /* LOG_ERR() */ #include #include "io/lm3s.h" #include "irq_lm3s.h" @@ -43,9 +44,15 @@ static void (*irq_table[NUM_INTERRUPTS])(void) __attribute__((section("vtable"))); -static void unhandled_isr(void) +/* Unhandled IRQ */ +static NORETURN NAKED void unhandled_isr(void) { - /* Unhandled IRQ */ + reg32_t reg; + + asm volatile ("mrs %0, ipsr" : "=r"(reg)); + LOG_ERR("unhandled IRQ %lu\n", reg); + PAUSE; + UNREACHABLE(); ASSERT(0); }