cc2538: nvic: Simplify VTABLE configuration

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 <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
Benoît Thébaudeau 2015-06-26 00:31:15 +02:00
parent efb4b858e2
commit a191fcdb84
2 changed files with 5 additions and 10 deletions

View File

@ -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

View File

@ -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
/** @} */
/*---------------------------------------------------------------------------*/