Dedicated isr implementation

This commit is contained in:
Romain Goyet
2015-05-04 15:53:00 +02:00
parent 602fb4c05b
commit 3c173e3219
2 changed files with 40 additions and 0 deletions

32
arch/stm32f429/isr.c Normal file
View File

@@ -0,0 +1,32 @@
#include "isr.h"
extern const void * _stack_start;
/* Interrupt Service Routines are void->void functions */
typedef void(*ISR)(void);
/* Notice: The Cortex-M4 expects all jumps to be made at an odd address when
* jumping to Thumb code. For example, if you want to execute Thumb code at
* address 0x100, you'll have to jump to 0x101. Luckily, this idiosyncrasy is
* properly handled by the C compiler that will generate proper addresses when
* using function pointers. */
#define INITIALISATION_VECTOR_SIZE 0x6B
ISR InitialisationVector[INITIALISATION_VECTOR_SIZE]
__attribute__((section(".isr_vector_table")))
= {
(ISR)&_stack_start,
_ResetServiceRoutine,
_NMIServiceRoutine,
_HardFaultServiceRoutine,
_MemManageServiceRoutine,
_BusFaultServiceRoutine,
0, // UsageFault
0, // Reserved
_SVCallServiceRoutine,
0, // Debug Monitor
_PendSVServiceRoutine,
_SysTickServiceRoutine,
0
};

8
arch/stm32f429/isr.h Normal file
View File

@@ -0,0 +1,8 @@
void _ResetServiceRoutine(void);
void _NMIServiceRoutine(void);
void _HardFaultServiceRoutine(void);
void _MemManageServiceRoutine(void);
void _BusFaultServiceRoutine(void);
void _SVCallServiceRoutine(void);
void _PendSVServiceRoutine(void);
void _SysTickServiceRoutine(void);