-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinterrupts.c
50 lines (42 loc) · 1.07 KB
/
interrupts.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <stdint.h>
#include "typedef.h"
#include "interrupts.h"
#include "arm_lowlev.h"
unex_irq_t unex_irq = { 0 };
// Should be actually NOT used but hey, just in case
void _WEAK_ isrNotUsed(void) {
static uint32_t count = 0;
unex_irq.not_used = 1;
if (count++ >= 10) disableAll();
}
void _WEAK_ isrUndefined(void) {
static uint32_t count = 0;
unex_irq.undefined = 1;
if (count++ >= 10) disableAll();
}
void _WEAK_ isrPrftchAbrt(void) {
static uint32_t count = 0;
unex_irq.prefetch_abort = 1;
if (count++ >= 10) disableAll();
}
void _WEAK_ isrDataAbrt(void) {
static uint32_t count = 0;
unex_irq.data_abort = 1;
if (count++ >= 10) disableAll();
}
void _WEAK_ isrSuperCall(void) {
static uint32_t count = 0;
unex_irq.super_call = 1;
if (count++ >= 10) disableAll();
}
void _WEAK_ isrIRQ(void) {
static uint32_t count = 0;
unex_irq.IRQ = 1;
if (count++ >= 10) disableAll();
}
void _WEAK_ isrFIQ(void) {
static uint32_t count = 0;
unex_irq.FIQ = 1;
if (count++ >= 10) disableAll();
}