From 34a467fa89d01c8248fabc52bc5a4f5edf67570a Mon Sep 17 00:00:00 2001 From: arighi Date: Wed, 31 Mar 2010 14:41:55 +0000 Subject: [PATCH] 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 --- bertos/cpu/cortex-m3/drv/irq_lm3s.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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); } -- 2.25.1