Skip to content

Commit

Permalink
ADD: relocate interrupts to sram
Browse files Browse the repository at this point in the history
  • Loading branch information
r2axz committed Dec 1, 2020
1 parent a5e220b commit e142c45
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions system_interrupts.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#include <string.h>
#include <stm32f1xx.h>
#include "system_interrupts.h"

#define SYSTEM_INTERRUPTS_COUNT 68
#define SYSTEM_INTERRUPTS_TABLE_ALIGNMENT 0x200

static volatile void *_sram_interrupt_table[SYSTEM_INTERRUPTS_COUNT] __attribute__ ((aligned(SYSTEM_INTERRUPTS_TABLE_ALIGNMENT)));

void system_interrupts_init() {
memcpy(_sram_interrupt_table, (const void *)SCB->VTOR, sizeof(_sram_interrupt_table));
SCB->VTOR = (uint32_t)_sram_interrupt_table;
NVIC_SetPriorityGrouping(SYSTEM_INTERRUPTS_PRIORITY_GROUPING);
}

0 comments on commit e142c45

Please sign in to comment.