Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
cmsis_nvic.c
00001 /* mbed Microcontroller Library - cmsis_nvic for LPC11U24 00002 * Copyright (c) 2011 ARM Limited. All rights reserved. 00003 * 00004 * CMSIS-style functionality to support dynamic vectors 00005 */ 00006 #include "cmsis_nvic.h" 00007 00008 #define NVIC_NUM_VECTORS (16 + 32) // CORE + MCU Peripherals 00009 #define NVIC_RAM_VECTOR_ADDRESS (0x10000000) // Vectors positioned at start of RAM 00010 00011 void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { 00012 static volatile uint32_t* vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS; 00013 int i; 00014 00015 // Copy and switch to dynamic vectors if first time called 00016 if (SCB->VTOR != NVIC_RAM_VECTOR_ADDRESS) { 00017 uint32_t *old_vectors = (uint32_t*)SCB->VTOR; 00018 for (i=0; i<NVIC_NUM_VECTORS; i++) { 00019 vectors[i] = old_vectors[i]; 00020 } 00021 SCB->VTOR = (uint32_t)vectors; 00022 } 00023 00024 vectors[IRQn + 16] = vector; 00025 } 00026 00027 uint32_t NVIC_GetVector(IRQn_Type IRQn) { 00028 uint32_t *vectors = (uint32_t*)SCB->VTOR; 00029 return vectors[IRQn + 16]; 00030 }
Generated on Tue Jul 12 2022 13:47:00 by
1.7.2
