-
Notifications
You must be signed in to change notification settings - Fork 0
/
isr_vectors.cpp
189 lines (165 loc) · 4.24 KB
/
isr_vectors.cpp
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#include "isr_vectors.hpp"
#include "board.hpp"
[[noreturn]] void reset_handler()
{
asm("b main");
while(1);
}
[[noreturn]] void nmi_handler()
{
while (1);
}
[[noreturn]] void hard_fault_handler()
{
while (1);
}
[[noreturn]] void memory_management_fault_handler()
{
while (1);
}
[[noreturn]] void bus_fault_handler()
{
while (1);
}
[[noreturn]] void usage_fault_handler()
{
while (1);
}
[[noreturn]] void sv_call_handler()
{
while (1);
}
[[noreturn]] void pend_sv_handler()
{
while (1);
}
[[noreturn]] void sys_tick_handler()
{
while (1);
}
[[noreturn]] void default_handler()
{
while (1);
}
void (* const isr_vectors[])() =
{
reset_handler,
nmi_handler,
hard_fault_handler,
memory_management_fault_handler,
bus_fault_handler,
usage_fault_handler,
};
void (* const isr_sv_call[])() =
{
sv_call_handler,
};
void (* const isr_vector_last_sys[])() =
{
pend_sv_handler,
sys_tick_handler,
};
#if 0
// Use this to determine if the mapping is correct by
// comparing line numbers here to addresses in app.xxd.
#define use_default_handler_for(peripheral) \
reinterpret_cast<void(*)()>(__LINE__)
#else
#define use_default_handler_for(peripheral) \
default_handler
#endif
void (* const isr_vector_rest0[])() =
{
use_default_handler_for(gpio_port_a),
use_default_handler_for(gpio_port_b),
use_default_handler_for(gpio_port_c),
use_default_handler_for(gpio_port_d),
use_default_handler_for(gpio_port_e),
use_default_handler_for(uart0),
use_default_handler_for(uart1),
use_default_handler_for(ssi0),
use_default_handler_for(i2c0),
};
void (* const isr_vector_rest1[])() =
{
use_default_handler_for(adc0_sequence0),
use_default_handler_for(adc0_sequence1),
use_default_handler_for(adc0_sequence2),
use_default_handler_for(adc0_sequence3),
use_default_handler_for(wdt0_1),
use_default_handler_for(timer0a_16_32),
use_default_handler_for(timer0b_16_32),
use_default_handler_for(timer1a_16_32),
use_default_handler_for(timer1b_16_32),
use_default_handler_for(timer2a_16_32),
use_default_handler_for(timer2b_16_32),
use_default_handler_for(analog_comparator0),
use_default_handler_for(analog_comparator1),
};
void (* const isr_vector_rest2[])() =
{
use_default_handler_for(system_control),
use_default_handler_for(flash_memory_and_eeprom),
use_default_handler_for(gpio_port_f),
};
void (* const isr_vector_rest3[])() =
{
use_default_handler_for(uart2),
use_default_handler_for(ssi1),
use_default_handler_for(timer3a_16_32),
use_default_handler_for(timer3b_16_32),
use_default_handler_for(i2c1),
};
void (* const isr_vector_rest4[])() =
{
use_default_handler_for(can0),
};
void (* const isr_vector_rest5[])() =
{
use_default_handler_for(hibernation_module),
use_default_handler_for(usb),
};
void (* const isr_vector_rest6[])() =
{
use_default_handler_for(udma_software),
use_default_handler_for(udma_error),
use_default_handler_for(adc1_sequence0),
use_default_handler_for(adc1_sequence1),
use_default_handler_for(adc1_sequence2),
use_default_handler_for(adc1_sequence3),
};
void (* const isr_vector_rest7[])() =
{
use_default_handler_for(ssi2),
use_default_handler_for(ssi3),
use_default_handler_for(uart3),
use_default_handler_for(uart4),
use_default_handler_for(uart5),
use_default_handler_for(uart6),
use_default_handler_for(uart7),
};
void (* const isr_vector_rest8[])() =
{
use_default_handler_for(i2c2),
use_default_handler_for(i2c3),
use_default_handler_for(timer4a_16_32),
use_default_handler_for(timer4b_16_32),
};
void (* const isr_vector_rest9[])() =
{
use_default_handler_for(timer5a_16_32),
use_default_handler_for(timer5b_16_32),
use_default_handler_for(timer0a_32_64),
use_default_handler_for(timer0b_32_64),
use_default_handler_for(timer1a_32_64),
use_default_handler_for(timer1b_32_64),
use_default_handler_for(timer2a_32_64),
use_default_handler_for(timer2b_32_64),
use_default_handler_for(timer3a_32_64),
use_default_handler_for(timer3b_32_64),
use_default_handler_for(timer4a_32_64),
use_default_handler_for(timer4b_32_64),
use_default_handler_for(timer5a_32_64),
use_default_handler_for(timer5b_32_64),
use_default_handler_for(system_exception),
};