From a191fcdb84bb49e84933eed7c925330f5a051624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Fri, 26 Jun 2015 00:31:15 +0200 Subject: [PATCH] cc2538: nvic: Simplify VTABLE configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only thing needed for VTABLE is the absolute address of the vector table. Splitting it between code/SRAM base and offset complicates things and brings nothing. Consequently, this commit merges the NVIC VTABLE configurations into a single one giving the vector table absolute address. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/dev/nvic.c | 2 +- cpu/cc2538/dev/nvic.h | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cpu/cc2538/dev/nvic.c b/cpu/cc2538/dev/nvic.c index 86e97c093..71e2414f8 100644 --- a/cpu/cc2538/dev/nvic.c +++ b/cpu/cc2538/dev/nvic.c @@ -57,7 +57,7 @@ nvic_init() interrupt_unpend = (uint32_t *)NVIC_UNPEND0; /* Provide our interrupt table to the NVIC */ - REG(SCB_VTABLE) = (NVIC_CONF_VTABLE_BASE + NVIC_CONF_VTABLE_OFFSET); + REG(SCB_VTABLE) = NVIC_VTABLE_ADDRESS; } /*---------------------------------------------------------------------------*/ void diff --git a/cpu/cc2538/dev/nvic.h b/cpu/cc2538/dev/nvic.h index b8c70b4a2..6c7563680 100644 --- a/cpu/cc2538/dev/nvic.h +++ b/cpu/cc2538/dev/nvic.h @@ -48,18 +48,13 @@ /** \name NVIC Constants and Configuration * @{ */ -#define NVIC_VTABLE_IN_SRAM 0x20000000 -#define NVIC_VTABLE_IN_CODE 0x00000000 - #define NVIC_INTERRUPT_ENABLED 0x00000001 #define NVIC_INTERRUPT_DISABLED 0x00000000 -#ifndef NVIC_CONF_VTABLE_BASE -#define NVIC_CONF_VTABLE_BASE NVIC_VTABLE_IN_CODE -#endif - -#ifndef NVIC_CONF_VTABLE_OFFSET -#define NVIC_CONF_VTABLE_OFFSET 0x200000 +#ifdef NVIC_CONF_VTABLE_ADDRESS +#define NVIC_VTABLE_ADDRESS NVIC_CONF_VTABLE_ADDRESS +#else +#define NVIC_VTABLE_ADDRESS 0x200000 #endif /** @} */ /*---------------------------------------------------------------------------*/