STM32F0 astyle

pull/14699/head
jeromecoutant 2021-05-25 14:28:43 +02:00
parent c02cb71b35
commit cedb1043f1
5 changed files with 11 additions and 9 deletions

View File

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