Subversion Repositories NaviCtrl

Rev

Rev 171 | 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
171 ingob 6
// + Nur für den privaten Gebrauch / NON-COMMERCIAL USE ONLY
1 ingob 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
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
171 ingob 28
// + Die Portierung oder Nutzung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur 
1 ingob 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 
171 ingob 43
// +   * porting the sources to other systems or using the software on other systems (except hardware from www.mikrokopter.de) is not allowed
1 ingob 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
{
154 killagreg 167
        /* write your handler here */
41 ingob 168
 
169
        /*write any value to VIC0 VAR*/  
170
        VIC0->VAR = 0xFF;
1 ingob 171
}
172
/*******************************************************************************
173
* Function Name  : ARMRX_IRQHandler
174
* Description    : This function handles the ARMRX interrupt request
175
*******************************************************************************/
176
void ARMRX_IRQHandler(void)
177
{
41 ingob 178
        /*write your handler here*/
179
        /* ... */
180
 
181
 
182
        /*write any value to VIC0 VAR*/  
183
        VIC0->VAR = 0xFF;
1 ingob 184
}
185
/*******************************************************************************
186
* Function Name  : ARMTX_IRQHandler
187
* Description    : This function handles the ARMTX interrupt request
188
*******************************************************************************/
189
void ARMTX_IRQHandler(void)
190
{
41 ingob 191
        /*write your handler here*/
192
        /* ... */
193
 
194
 
195
        /*write any value to VIC0 VAR*/  
196
        VIC0->VAR = 0xFF;
1 ingob 197
}
198
/*******************************************************************************
199
* Function Name  : TIM0_IRQHandler
200
* Description    : This function handles the TIM0 interrupt request
201
*******************************************************************************/
202
void TIM0_IRQHandler(void)
203
{
41 ingob 204
        /*write your handler here*/
205
        /* ... */
206
 
207
 
208
        /*write any value to VIC0 VAR*/  
209
        VIC0->VAR = 0xFF;
1 ingob 210
}
211
/*******************************************************************************
212
* Function Name  : TIM1_IRQHandler
213
* Description    : This function handles the TIM1 interrupt request
214
*******************************************************************************/
41 ingob 215
/*
216
void TIM1_IRQHandler(void)
217
{
218
   // write any value to VIC0 VAR //  
219
   VIC0->VAR = 0xFF;
220
}
221
*/
1 ingob 222
/*******************************************************************************
223
* Function Name  : TIM2_IRQHandler
224
* Description    : This function handles the TIM2 interrupt request
225
*******************************************************************************/
119 killagreg 226
/*
1 ingob 227
void TIM2_IRQHandler(void)
119 killagreg 228
{      
229
        // write any value to VIC0 VAR //  
41 ingob 230
        VIC0->VAR = 0xFF;
1 ingob 231
}
119 killagreg 232
*/
1 ingob 233
/*******************************************************************************
234
* Function Name  : TIM3_IRQHandler
235
* Description    : This function handles the TIM3 interrupt request
236
*******************************************************************************/
237
void TIM3_IRQHandler(void)
238
{
41 ingob 239
        /*write your handler here*/
240
        /* ... */
241
 
242
 
243
        /*write any value to VIC0 VAR*/  
244
        VIC0->VAR = 0xFF;
1 ingob 245
}
246
/*******************************************************************************
247
* Function Name  : USBHP_IRQHandler
248
* Description    : This function handles the USBHP interrupt request
249
*******************************************************************************/
250
void USBHP_IRQHandler(void)
251
{
41 ingob 252
        CTR_HP();
253
        /*write any value to VIC0 VAR*/  
254
        VIC0->VAR = 0xFF;
1 ingob 255
}
256
/*******************************************************************************
257
* Function Name  : USBLP_IRQHandler
258
* Description    : This function handles the USBLP interrupt request
259
*******************************************************************************/
260
void USBLP_IRQHandler(void)
261
{
41 ingob 262
        USB_Istr();     /*write any value to VIC0 VAR*/  
263
        VIC0->VAR = 0xFF;
1 ingob 264
}
265
/*******************************************************************************
266
* Function Name  : SCU_IRQHandler
267
* Description    : This function handles the SCU interrupt request
268
*******************************************************************************/
269
void SCU_IRQHandler(void)
270
{
41 ingob 271
        /*write your handler here*/
272
        /* ... */
273
 
274
 
275
        /*write any value to VIC0 VAR*/  
276
        VIC0->VAR = 0xFF;
1 ingob 277
}
278
/*******************************************************************************
279
* Function Name  : ENET_IRQHandler
280
* Description    : This function handles the DENET interrupt request
281
*******************************************************************************/
282
void ENET_IRQHandler(void)
283
{
41 ingob 284
        /*write your handler here*/
285
        /* ... */
286
 
287
 
288
        /*write any value to VIC0 VAR*/  
289
        VIC0->VAR = 0xFF;
1 ingob 290
}
291
/*******************************************************************************
292
* Function Name  : DMA_IRQHandler
293
* Description    : This function handles the DMA interrupt request
294
*******************************************************************************/
295
void DMA_IRQHandler(void)
296
{
41 ingob 297
        /*write your handler here*/
298
        /* ... */
299
 
300
 
301
        /*write any value to VIC0 VAR*/  
302
        VIC0->VAR = 0xFF;
1 ingob 303
}
304
/*******************************************************************************
305
* Function Name  : CAN_IRQHandler
306
* Description    : This function handles the CAN interrupt request
307
*******************************************************************************/
308
void CAN_IRQHandler(void)
309
{
41 ingob 310
        /*write your handler here*/
311
        /* ... */
312
 
313
 
314
        /*write any value to VIC0 VAR*/  
315
        VIC0->VAR = 0xFF;
1 ingob 316
}
317
/*******************************************************************************
318
* Function Name  : MC_IRQHandler
319
* Description    : This function handles the MC interrupt request
320
*******************************************************************************/
321
void MC_IRQHandler(void)
322
{
41 ingob 323
        /*write your handler here*/
324
        /* ... */
325
 
326
 
327
        /*write any value to VIC0 VAR*/  
328
        VIC0->VAR = 0xFF;
1 ingob 329
}
330
/*******************************************************************************
331
* Function Name  : ADC_IRQHandler
332
* Description    : This function handles the ADC interrupt request
333
*******************************************************************************/
134 killagreg 334
/*
1 ingob 335
void ADC_IRQHandler(void)
336
{
134 killagreg 337
        //write your handler here              
41 ingob 338
 
134 killagreg 339
        //write any value to VIC0 VAR
41 ingob 340
        VIC0->VAR = 0xFF;
134 killagreg 341
} */
1 ingob 342
/*******************************************************************************
343
* Function Name  : UART0_IRQHandler
344
* Description    : This function handles the UART0 interrupt request
345
*******************************************************************************/
346
/*void UART0_IRQHandler(void)
347
{
348
} */
349
/*******************************************************************************
350
* Function Name  : UART1_IRQHandler
351
* Description    : This function handles the UART1 interrupt request
352
*******************************************************************************/
353
/*void UART1_IRQHandler(void)
41 ingob 354
{      
355
} */
1 ingob 356
/*******************************************************************************
357
* Function Name  : UART2_IRQHandler
358
* Description    : This function handles the UART2 interrupt request
359
*******************************************************************************/
41 ingob 360
/*void UART2_IRQHandler(void)
1 ingob 361
{
41 ingob 362
} */
1 ingob 363
/*******************************************************************************
364
* Function Name  : I2C0_IRQHandler
365
* Description    : This function handles the I2C0 interrupt request
366
*******************************************************************************/
367
void I2C0_IRQHandler(void)
368
{
369
}
370
/*******************************************************************************
371
* Function Name  : I2C1_IRQHandler
372
* Description    : This function handles the I2C1 interrupt request
373
*******************************************************************************/
374
/*void I2C1_IRQHandler(void)
375
{
376
} */
377
/*******************************************************************************
378
* Function Name  : SSP0_IRQHandler
379
* Description    : This function handles the SSP0 interrupt request
380
*******************************************************************************/
381
/*void SSP0_IRQHandler(void)
382
{
383
} */
384
/*******************************************************************************
385
* Function Name  : SSP1_IRQHandler
386
* Description    : This function handles the SSP1 interrupt request
387
*******************************************************************************/
388
void SSP1_IRQHandler(void)
389
{
390
}
391
/*******************************************************************************
392
* Function Name  : LVD_IRQHandler
393
* Description    : This function handles the LVD interrupt request
394
*******************************************************************************/
395
void LVD_IRQHandler(void)
396
{
397
}
398
/*******************************************************************************
399
* Function Name  : RTC_IRQHandler
400
* Description    : This function handles the RTC interrupt request
401
*******************************************************************************/
402
void RTC_IRQHandler(void)
403
{
404
}
405
/*******************************************************************************
406
* Function Name  : WIU_IRQHandler
407
* Description    : This function handles the WIU interrupt request
408
*******************************************************************************/
409
void WIU_IRQHandler(void)
410
{
411
}
412
/*******************************************************************************
413
* Function Name  : EXTIT0_IRQHandler
414
* Description    : This function handles the EXTIT0 interrupt request
415
*******************************************************************************/
416
void EXTIT0_IRQHandler(void)
417
{
418
}
419
/*******************************************************************************
420
* Function Name  : EXTIT1_IRQHandler
421
* Description    : This function handles the EXTIT1 interrupt request
422
*******************************************************************************/
41 ingob 423
void EXTIT1_IRQHandler(void)
1 ingob 424
{
24 StephanB 425
        VIC_ITCmd(EXTIT1_ITLine, DISABLE);
426
        if(WIU_GetITStatus(WIU_Line11) != RESET)
427
        {
428
                BeepTime = 100;
41 ingob 429
                Fat16_Init(); // initialize sd-card file system.
24 StephanB 430
 
431
                WIU_ClearFlag(WIU_Line1);
432
                WIU_ClearITPendingBit(WIU_Line11);
433
        }
434
        VIC_ITCmd(EXTIT1_ITLine, ENABLE);
1 ingob 435
}
436
/*******************************************************************************
437
* Function Name  : EXTIT2_IRQHandler
438
* Description    : This function handles the EXTIT2 interrupt request
439
*******************************************************************************/
440
void EXTIT2_IRQHandler(void)
441
{
442
}
443
/*******************************************************************************
444
* Function Name  : EXTIT3_IRQHandler
445
* Description    : This function handles the EXTIT3 interrupt request
446
*******************************************************************************/
154 killagreg 447
/*
1 ingob 448
void EXTIT3_IRQHandler(void)
449
{
450
}
154 killagreg 451
*/
1 ingob 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