mirror of https://github.com/ARMmbed/mbed-os.git
STM32F0 astyle
parent
c02cb71b35
commit
cedb1043f1
|
|
@ -18,7 +18,8 @@
|
||||||
|
|
||||||
#define NVIC_USER_IRQ_OFFSET 16
|
#define NVIC_USER_IRQ_OFFSET 16
|
||||||
|
|
||||||
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
|
void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Copy and switch to dynamic vectors if first time called
|
// Copy and switch to dynamic vectors if first time called
|
||||||
|
|
@ -34,7 +35,8 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
|
||||||
*((uint32_t *)(NVIC_RAM_VECTOR_ADDRESS + (IRQn * 4) + (NVIC_USER_IRQ_OFFSET * 4))) = vector;
|
*((uint32_t *)(NVIC_RAM_VECTOR_ADDRESS + (IRQn * 4) + (NVIC_USER_IRQ_OFFSET * 4))) = vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t NVIC_GetVector(IRQn_Type IRQn) {
|
uint32_t NVIC_GetVector(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
uint32_t *vectors = (uint32_t *)NVIC_RAM_VECTOR_ADDRESS;
|
uint32_t *vectors = (uint32_t *)NVIC_RAM_VECTOR_ADDRESS;
|
||||||
// Return the vector
|
// Return the vector
|
||||||
return vectors[IRQn + 16];
|
return vectors[IRQn + 16];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue