Subversion Repositories NaviCtrl

Rev

Rev 119 | Rev 154 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
/*#######################################################################################*/
2
/* !!! THIS IS NOT FREE SOFTWARE !!!                                                     */
3
/*#######################################################################################*/
4
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5
// + Copyright (c) 2008 Ingo Busker, Holger Buss
6
// + Nur für den privaten Gebrauch
7
// + FOR NON COMMERCIAL USE ONLY
8
// + www.MikroKopter.com
9
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10
// + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), 
11
// + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. 
12
// + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt 
13
// + bzgl. der Nutzungsbedingungen aufzunehmen. 
14
// + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen,
15
// + Verkauf von Luftbildaufnahmen, usw.
16
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17
// + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, 
18
// + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen
19
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20
// + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts
21
// + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de"
22
// + eindeutig als Ursprung verlinkt werden
23
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24
// + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion
25
// + Benutzung auf eigene Gefahr
26
// + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden
27
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28
// + Die PORTIERUNG der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur 
29
// + mit unserer Zustimmung zulässig
30
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
// + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen
32
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33
// + Redistributions of source code (with or without modifications) must retain the above copyright notice, 
34
// + this list of conditions and the following disclaimer.
35
// +   * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived
36
// +     from this software without specific prior written permission.
37
// +   * The use of this project (hardware, software, binary files, sources and documentation) is only permitted 
38
// +     for non-commercial use (directly or indirectly)
39
// +     Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted 
40
// +     with our written permission
41
// +   * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be 
42
// +     clearly linked as origin 
43
// +   * PORTING this software (or part of it) to systems (other than hardware from www.mikrokopter.de) is NOT allowed
44
//
45
// +  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
46
// +  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47
// +  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48
// +  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
49
// +  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
50
// +  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
51
// +  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
52
// +  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
53
// +  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
// +  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
55
// +  POSSIBILITY OF SUCH DAMAGE. 
56
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41 ingob 57
#include "91x_lib.h"
58
#include "usb_lib.h"
59
#include "fat16.h"
1 ingob 60
#include "main.h"
41 ingob 61
#include "uart1.h"
1 ingob 62
#define global extern   /* to declare external variables and functions      */
63
 
64
extern void USB_Istr(void);
65
 
66
void SWI_Handler (void)       __attribute__ ((interrupt ("SWI")));
67
void Prefetch_Handler (void)  __attribute__ ((interrupt ("ABORT")));
68
void Abort_Handler (void)     __attribute__ ((interrupt ("ABORT")));
69
void Undefined_Handler (void) __attribute__ ((interrupt ("UNDEF")));
70
void FIQ_Handler (void)       __attribute__ ((interrupt ("FIQ")));
71
 
72
void Dummy_Handler(void)
73
{
41 ingob 74
        VIC0->VAR = 0xFF;
75
        VIC1->VAR = 0xFF;
1 ingob 76
}
77
 
41 ingob 78
/* avoid the surprising reset-like behaviour by spurious interrupts */
79
void Interrupt_Init(void)
1 ingob 80
{
81
  VIC0->DVAR = (u32)Dummy_Handler;
82
  VIC1->DVAR = (u32)Dummy_Handler;
83
}
41 ingob 84
/*******************************************************************************
85
* Function Name  : SWI_Handler
86
* Description    : This function handles SW exception.
87
* Input          : None
88
* Output         : None
89
* Return         : None
90
*******************************************************************************/
1 ingob 91
void SWI_Handler (void)
92
{
93
}
94
 
41 ingob 95
/*******************************************************************************
96
* Function Name  : Abort_Handler
97
* Description    : This function handles data abort exception.
98
* Input          : None
99
* Output         : None
100
* Return         : None
101
*******************************************************************************/
1 ingob 102
void Abort_Handler (void)
103
{
110 killagreg 104
        UART1_PutString("\r\nAbort Handler");
41 ingob 105
        while(1)
106
        {
107
        // infinite loop
108
        }
1 ingob 109
}
110
 
41 ingob 111
/*******************************************************************************
112
* Function Name  : Undefined_Handler
113
* Description    : This function handles undefined instruction exception.
114
* Input          : None
115
* Output         : None
116
* Return         : None
117
*******************************************************************************/
1 ingob 118
void Undefined_Handler (void)
119
{
110 killagreg 120
        UART1_PutString("\r\nUndefined Handler");
41 ingob 121
        while(1)
122
        {
123
        // infinite loop
124
        }
1 ingob 125
}
41 ingob 126
/*******************************************************************************
127
* Function Name  : FIQ_Handler
128
* Description    : This function handles FIQ exception.
129
* Input          : None
130
* Output         : None
131
* Return         : None
132
*******************************************************************************/
1 ingob 133
void FIQ_Handler (void)
134
{
41 ingob 135
}
1 ingob 136
/*******************************************************************************
137
* Function Name  : Prefetch_Handler
138
* Description    : This function handles preftetch abort exception.
139
*******************************************************************************/
140
void Prefetch_Handler(void)
141
{
110 killagreg 142
        UART1_PutString("\r\nPrefetch Handler");
41 ingob 143
        while(1)
144
        {
145
        // infinite loop
146
        }
1 ingob 147
}
148
/*******************************************************************************
149
* Function Name  : WDG_IRQHandler
150
* Description    : This function handles the WDG interrupt request
151
*******************************************************************************/
152
void WDG_IRQHandler(void)
153
{
41 ingob 154
   /*write your handler here*/
155
   /* ... */
156
 
157
 
158
   /*write any value to VIC0 VAR*/  
159
   VIC0->VAR = 0xFF;
1 ingob 160
}
161
/*******************************************************************************
162
* Function Name  : SW_IRQHandler
163
* Description    : This function handles the SW interrupt request
164
*******************************************************************************/
165
void SW_IRQHandler(void)
166
{
41 ingob 167
        /*write your handler here*/
168
        /* ... */
169
 
170
 
171
        /*write any value to VIC0 VAR*/  
172
        VIC0->VAR = 0xFF;
1 ingob 173
}
174
/*******************************************************************************
175
* Function Name  : ARMRX_IRQHandler
176
* Description    : This function handles the ARMRX interrupt request
177
*******************************************************************************/
178
void ARMRX_IRQHandler(void)
179
{
41 ingob 180
        /*write your handler here*/
181
        /* ... */
182
 
183
 
184
        /*write any value to VIC0 VAR*/  
185
        VIC0->VAR = 0xFF;
1 ingob 186
}
187
/*******************************************************************************
188
* Function Name  : ARMTX_IRQHandler
189
* Description    : This function handles the ARMTX interrupt request
190
*******************************************************************************/
191
void ARMTX_IRQHandler(void)
192
{
41 ingob 193
        /*write your handler here*/
194
        /* ... */
195
 
196
 
197
        /*write any value to VIC0 VAR*/  
198
        VIC0->VAR = 0xFF;
1 ingob 199
}
200
/*******************************************************************************
201
* Function Name  : TIM0_IRQHandler
202
* Description    : This function handles the TIM0 interrupt request
203
*******************************************************************************/
204
void TIM0_IRQHandler(void)
205
{
41 ingob 206
        /*write your handler here*/
207
        /* ... */
208
 
209
 
210
        /*write any value to VIC0 VAR*/  
211
        VIC0->VAR = 0xFF;
1 ingob 212
}
213
/*******************************************************************************
214
* Function Name  : TIM1_IRQHandler
215
* Description    : This function handles the TIM1 interrupt request
216
*******************************************************************************/
41 ingob 217
/*
218
void TIM1_IRQHandler(void)
219
{
220
   // write any value to VIC0 VAR //  
221
   VIC0->VAR = 0xFF;
222
}
223
*/
1 ingob 224
/*******************************************************************************
225
* Function Name  : TIM2_IRQHandler
226
* Description    : This function handles the TIM2 interrupt request
227
*******************************************************************************/
119 killagreg 228
/*
1 ingob 229
void TIM2_IRQHandler(void)
119 killagreg 230
{      
231
        // write any value to VIC0 VAR //  
41 ingob 232
        VIC0->VAR = 0xFF;
1 ingob 233
}
119 killagreg 234
*/
1 ingob 235
/*******************************************************************************
236
* Function Name  : TIM3_IRQHandler
237
* Description    : This function handles the TIM3 interrupt request
238
*******************************************************************************/
239
void TIM3_IRQHandler(void)
240
{
41 ingob 241
        /*write your handler here*/
242
        /* ... */
243
 
244
 
245
        /*write any value to VIC0 VAR*/  
246
        VIC0->VAR = 0xFF;
1 ingob 247
}
248
/*******************************************************************************
249
* Function Name  : USBHP_IRQHandler
250
* Description    : This function handles the USBHP interrupt request
251
*******************************************************************************/
252
void USBHP_IRQHandler(void)
253
{
41 ingob 254
        CTR_HP();
255
        /*write any value to VIC0 VAR*/  
256
        VIC0->VAR = 0xFF;
1 ingob 257
}
258
/*******************************************************************************
259
* Function Name  : USBLP_IRQHandler
260
* Description    : This function handles the USBLP interrupt request
261
*******************************************************************************/
262
void USBLP_IRQHandler(void)
263
{
41 ingob 264
        USB_Istr();     /*write any value to VIC0 VAR*/  
265
        VIC0->VAR = 0xFF;
1 ingob 266
}
267
/*******************************************************************************
268
* Function Name  : SCU_IRQHandler
269
* Description    : This function handles the SCU interrupt request
270
*******************************************************************************/
271
void SCU_IRQHandler(void)
272
{
41 ingob 273
        /*write your handler here*/
274
        /* ... */
275
 
276
 
277
        /*write any value to VIC0 VAR*/  
278
        VIC0->VAR = 0xFF;
1 ingob 279
}
280
/*******************************************************************************
281
* Function Name  : ENET_IRQHandler
282
* Description    : This function handles the DENET interrupt request
283
*******************************************************************************/
284
void ENET_IRQHandler(void)
285
{
41 ingob 286
        /*write your handler here*/
287
        /* ... */
288
 
289
 
290
        /*write any value to VIC0 VAR*/  
291
        VIC0->VAR = 0xFF;
1 ingob 292
}
293
/*******************************************************************************
294
* Function Name  : DMA_IRQHandler
295
* Description    : This function handles the DMA interrupt request
296
*******************************************************************************/
297
void DMA_IRQHandler(void)
298
{
41 ingob 299
        /*write your handler here*/
300
        /* ... */
301
 
302
 
303
        /*write any value to VIC0 VAR*/  
304
        VIC0->VAR = 0xFF;
1 ingob 305
}
306
/*******************************************************************************
307
* Function Name  : CAN_IRQHandler
308
* Description    : This function handles the CAN interrupt request
309
*******************************************************************************/
310
void CAN_IRQHandler(void)
311
{
41 ingob 312
        /*write your handler here*/
313
        /* ... */
314
 
315
 
316
        /*write any value to VIC0 VAR*/  
317
        VIC0->VAR = 0xFF;
1 ingob 318
}
319
/*******************************************************************************
320
* Function Name  : MC_IRQHandler
321
* Description    : This function handles the MC interrupt request
322
*******************************************************************************/
323
void MC_IRQHandler(void)
324
{
41 ingob 325
        /*write your handler here*/
326
        /* ... */
327
 
328
 
329
        /*write any value to VIC0 VAR*/  
330
        VIC0->VAR = 0xFF;
1 ingob 331
}
332
/*******************************************************************************
333
* Function Name  : ADC_IRQHandler
334
* Description    : This function handles the ADC interrupt request
335
*******************************************************************************/
134 killagreg 336
/*
1 ingob 337
void ADC_IRQHandler(void)
338
{
134 killagreg 339
        //write your handler here              
41 ingob 340
 
134 killagreg 341
        //write any value to VIC0 VAR
41 ingob 342
        VIC0->VAR = 0xFF;
134 killagreg 343
} */
1 ingob 344
/*******************************************************************************
345
* Function Name  : UART0_IRQHandler
346
* Description    : This function handles the UART0 interrupt request
347
*******************************************************************************/
348
/*void UART0_IRQHandler(void)
349
{
350
} */
351
/*******************************************************************************
352
* Function Name  : UART1_IRQHandler
353
* Description    : This function handles the UART1 interrupt request
354
*******************************************************************************/
355
/*void UART1_IRQHandler(void)
41 ingob 356
{      
357
} */
1 ingob 358
/*******************************************************************************
359
* Function Name  : UART2_IRQHandler
360
* Description    : This function handles the UART2 interrupt request
361
*******************************************************************************/
41 ingob 362
/*void UART2_IRQHandler(void)
1 ingob 363
{
41 ingob 364
} */
1 ingob 365
/*******************************************************************************
366
* Function Name  : I2C0_IRQHandler
367
* Description    : This function handles the I2C0 interrupt request
368
*******************************************************************************/
369
void I2C0_IRQHandler(void)
370
{
371
}
372
/*******************************************************************************
373
* Function Name  : I2C1_IRQHandler
374
* Description    : This function handles the I2C1 interrupt request
375
*******************************************************************************/
376
/*void I2C1_IRQHandler(void)
377
{
378
} */
379
/*******************************************************************************
380
* Function Name  : SSP0_IRQHandler
381
* Description    : This function handles the SSP0 interrupt request
382
*******************************************************************************/
383
/*void SSP0_IRQHandler(void)
384
{
385
} */
386
/*******************************************************************************
387
* Function Name  : SSP1_IRQHandler
388
* Description    : This function handles the SSP1 interrupt request
389
*******************************************************************************/
390
void SSP1_IRQHandler(void)
391
{
392
}
393
/*******************************************************************************
394
* Function Name  : LVD_IRQHandler
395
* Description    : This function handles the LVD interrupt request
396
*******************************************************************************/
397
void LVD_IRQHandler(void)
398
{
399
}
400
/*******************************************************************************
401
* Function Name  : RTC_IRQHandler
402
* Description    : This function handles the RTC interrupt request
403
*******************************************************************************/
404
void RTC_IRQHandler(void)
405
{
406
}
407
/*******************************************************************************
408
* Function Name  : WIU_IRQHandler
409
* Description    : This function handles the WIU interrupt request
410
*******************************************************************************/
411
void WIU_IRQHandler(void)
412
{
413
}
414
/*******************************************************************************
415
* Function Name  : EXTIT0_IRQHandler
416
* Description    : This function handles the EXTIT0 interrupt request
417
*******************************************************************************/
418
void EXTIT0_IRQHandler(void)
419
{
420
}
421
/*******************************************************************************
422
* Function Name  : EXTIT1_IRQHandler
423
* Description    : This function handles the EXTIT1 interrupt request
424
*******************************************************************************/
41 ingob 425
void EXTIT1_IRQHandler(void)
1 ingob 426
{
24 StephanB 427
        VIC_ITCmd(EXTIT1_ITLine, DISABLE);
428
        if(WIU_GetITStatus(WIU_Line11) != RESET)
429
        {
430
                BeepTime = 100;
41 ingob 431
                Fat16_Init(); // initialize sd-card file system.
24 StephanB 432
 
433
                WIU_ClearFlag(WIU_Line1);
434
                WIU_ClearITPendingBit(WIU_Line11);
435
        }
436
        VIC_ITCmd(EXTIT1_ITLine, ENABLE);
1 ingob 437
}
438
/*******************************************************************************
439
* Function Name  : EXTIT2_IRQHandler
440
* Description    : This function handles the EXTIT2 interrupt request
441
*******************************************************************************/
442
void EXTIT2_IRQHandler(void)
443
{
444
}
445
/*******************************************************************************
446
* Function Name  : EXTIT3_IRQHandler
447
* Description    : This function handles the EXTIT3 interrupt request
448
*******************************************************************************/
449
void EXTIT3_IRQHandler(void)
450
{
451
}
452
/*******************************************************************************
453
* Function Name  : USBWU_IRQHandler
454
* Description    : This function handles the USBWU interrupt request
455
*******************************************************************************/
456
void USBWU_IRQHandler(void)
457
{
458
}
459
/*******************************************************************************
460
* Function Name  : PFQBC_IRQHandler
461
* Description    : This function handles the PFQBC interrupt request
462
*******************************************************************************/
463
void PFQBC_IRQHandler(void)
464
{
465
}
466