-
Notifications
You must be signed in to change notification settings - Fork 0
/
app_vect.c
324 lines (276 loc) · 10.1 KB
/
app_vect.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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
/*
*********************************************************************************************************
* EXAMPLE CODE
*
* (c) Copyright 2009; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
* Knowledge of the source code may not be used to write a similar
* product. This file may only be used in accordance with a license
* and should not be redistributed in any way.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* EXCEPTION VECTORS
*
* LUMINARY MICRO LM3S9B90 on the EK-LM3S9B90
*
* Filename : app_vect.c
* Version : V1.02
* Programmer(s) : BAN
*********************************************************************************************************
*/
#include <includes.h>
/*
*********************************************************************************************************
* LOCAL DEFINES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* LOCAL DATA TYPES
*********************************************************************************************************
*/
typedef union {
CPU_FNCT_VOID Fnct;
void *Ptr;
} APP_INTVECT_ELEM;
/*
*********************************************************************************************************
* LOCAL TABLES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/
#pragma language=extended
#pragma segment="CSTACK"
static void App_NMI_ISR (void);
static void App_Fault_ISR (void);
static void App_BusFault_ISR (void);
static void App_UsageFault_ISR (void);
static void App_MemFault_ISR (void);
static void App_Spurious_ISR (void);
extern void __iar_program_start(void);
/*
*********************************************************************************************************
* LOCAL CONFIGURATION ERRORS
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* EXCEPTION / INTERRUPT VECTOR TABLE
*
* Note(s) : (1) The Cortex-M3 may have up to 256 external interrupts, which are the final entries in the
* vector table. The LM3Sxxxx has 54 external interrupt vectors.
*********************************************************************************************************
*/
__root const APP_INTVECT_ELEM __vector_table[] @ ".intvec" = {
{ .Ptr = (void *)__sfe( "CSTACK" )}, /* 0, SP start value. */
__iar_program_start, /* 1, PC start value. */
App_NMI_ISR, /* 2, NMI. */
App_Fault_ISR, /* 3, Hard Fault. */
App_MemFault_ISR, /* 4, Memory Management. */
App_BusFault_ISR, /* 5, Bus Fault. */
App_UsageFault_ISR, /* 6, Usage Fault. */
App_Spurious_ISR, /* 7, Reserved. */
App_Spurious_ISR, /* 8, Reserved. */
App_Spurious_ISR, /* 9, Reserved. */
App_Spurious_ISR, /* 10, Reserved. */
App_Spurious_ISR, /* 11, SVCall. */
App_Spurious_ISR, /* 12, Debug Monitor. */
App_Spurious_ISR, /* 13, Reserved. */
OS_CPU_PendSVHandler, /* 14, PendSV Handler. */
OS_CPU_SysTickHandler, /* 15, uC/OS-II Tick ISR Handler. */
BSP_IntHandlerGPIOA,
BSP_IntHandlerGPIOB,
BSP_IntHandlerGPIOC,
BSP_IntHandlerGPIOD,
BSP_IntHandlerGPIOE,
BSP_IntHandlerUART0,
BSP_IntHandlerUART1,
BSP_IntHandlerSSI0,
BSP_IntHandlerI2C0,
App_Spurious_ISR,
App_Spurious_ISR,
App_Spurious_ISR,
App_Spurious_ISR,
App_Spurious_ISR,
BSP_IntHandlerADC0,
BSP_IntHandlerADC1,
BSP_IntHandlerADC2,
BSP_IntHandlerADC3,
BSP_IntHandlerWATCHDOG,
BSP_IntHandlerTIMER0A,
BSP_IntHandlerTIMER0B,
BSP_IntHandlerTIMER1A,
BSP_IntHandlerTIMER1B,
BSP_IntHandlerTIMER2A,
BSP_IntHandlerTIMER2B,
BSP_IntHandlerCOMP0,
BSP_IntHandlerCOMP1,
BSP_IntHandlerCOMP2,
BSP_IntHandlerSYSCTL,
BSP_IntHandlerFLASH,
BSP_IntHandlerGPIOF,
BSP_IntHandlerGPIOG,
BSP_IntHandlerGPIOH,
BSP_IntHandlerUART2,
BSP_IntHandlerSSI1,
BSP_IntHandlerTIMER3A,
BSP_IntHandlerTIMER3B,
BSP_IntHandlerI2C1,
App_Spurious_ISR,
BSP_IntHandlerCAN0,
BSP_IntHandlerCAN1,
App_Spurious_ISR,
BSP_IntHandlerETH,
BSP_IntHandlerHIBERNATE,
BSP_IntHandlerUSB,
App_Spurious_ISR,
BSP_IntHandlerUDMA_SW,
BSP_IntHandlerUDMA_ERR,
BSP_IntHandlerADC1_0,
BSP_IntHandlerADC1_1,
BSP_IntHandlerADC1_2,
BSP_IntHandlerADC1_3,
BSP_IntHandlerI2S0,
BSP_IntHandlerEPI,
BSP_IntHandlerGPIOJ
};
/*
*********************************************************************************************************
* App_NMI_ISR()
*
* Description : Handle Non-Maskable Interrupt (NMI).
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : (1) Since the NMI is not being used, this serves merely as a catch for a spurious
* exception.
*********************************************************************************************************
*/
static void App_NMI_ISR (void)
{
while (DEF_TRUE) {
;
}
}
/*
*********************************************************************************************************
* App_Fault_ISR()
*
* Description : Handle hard fault.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : none.
*********************************************************************************************************
*/
static void App_Fault_ISR (void)
{
while (DEF_TRUE) {
;
}
}
/*
*********************************************************************************************************
* App_BusFault_ISR()
*
* Description : Handle bus fault.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : none.
*********************************************************************************************************
*/
static void App_BusFault_ISR (void)
{
while (DEF_TRUE) {
;
}
}
/*
*********************************************************************************************************
* App_UsageFault_ISR()
*
* Description : Handle usage fault.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : none.
*********************************************************************************************************
*/
static void App_UsageFault_ISR (void)
{
while (DEF_TRUE) {
;
}
}
/*
*********************************************************************************************************
* App_MemFault_ISR()
*
* Description : Handle memory fault.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : none.
*********************************************************************************************************
*/
static void App_MemFault_ISR (void)
{
while (DEF_TRUE) {
;
}
}
/*
*********************************************************************************************************
* App_Spurious_ISR()
*
* Description : Handle spurious interrupt.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This is an ISR.
*
* Note(s) : none.
*********************************************************************************************************
*/
static void App_Spurious_ISR (void)
{
while (DEF_TRUE) {
;
}
}