Subversion Repositories NaviCtrl

Rev

Rev 70 | 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
{
41 ingob 104
        SerialPutString("\r\nAbort Handler");
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
{
41 ingob 120
        SerialPutString("\r\nUndefined Handler");
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
{
41 ingob 142
        SerialPutString("\r\nPrefetch Handler");
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
*******************************************************************************/
228
void TIM2_IRQHandler(void)
229
{
41 ingob 230
        /*write your handler here*/
231
        /* ... */
232
 
233
 
234
        /*write any value to VIC0 VAR*/  
235
        VIC0->VAR = 0xFF;
1 ingob 236
}
237
/*******************************************************************************
238
* Function Name  : TIM3_IRQHandler
239
* Description    : This function handles the TIM3 interrupt request
240
*******************************************************************************/
241
void TIM3_IRQHandler(void)
242
{
41 ingob 243
        /*write your handler here*/
244
        /* ... */
245
 
246
 
247
        /*write any value to VIC0 VAR*/  
248
        VIC0->VAR = 0xFF;
1 ingob 249
}
250
/*******************************************************************************
251
* Function Name  : USBHP_IRQHandler
252
* Description    : This function handles the USBHP interrupt request
253
*******************************************************************************/
254
void USBHP_IRQHandler(void)
255
{
41 ingob 256
        CTR_HP();
257
        /*write any value to VIC0 VAR*/  
258
        VIC0->VAR = 0xFF;
1 ingob 259
}
260
/*******************************************************************************
261
* Function Name  : USBLP_IRQHandler
262
* Description    : This function handles the USBLP interrupt request
263
*******************************************************************************/
264
void USBLP_IRQHandler(void)
265
{
41 ingob 266
        USB_Istr();     /*write any value to VIC0 VAR*/  
267
        VIC0->VAR = 0xFF;
1 ingob 268
}
269
/*******************************************************************************
270
* Function Name  : SCU_IRQHandler
271
* Description    : This function handles the SCU interrupt request
272
*******************************************************************************/
273
void SCU_IRQHandler(void)
274
{
41 ingob 275
        /*write your handler here*/
276
        /* ... */
277
 
278
 
279
        /*write any value to VIC0 VAR*/  
280
        VIC0->VAR = 0xFF;
1 ingob 281
}
282
/*******************************************************************************
283
* Function Name  : ENET_IRQHandler
284
* Description    : This function handles the DENET interrupt request
285
*******************************************************************************/
286
void ENET_IRQHandler(void)
287
{
41 ingob 288
        /*write your handler here*/
289
        /* ... */
290
 
291
 
292
        /*write any value to VIC0 VAR*/  
293
        VIC0->VAR = 0xFF;
1 ingob 294
}
295
/*******************************************************************************
296
* Function Name  : DMA_IRQHandler
297
* Description    : This function handles the DMA interrupt request
298
*******************************************************************************/
299
void DMA_IRQHandler(void)
300
{
41 ingob 301
        /*write your handler here*/
302
        /* ... */
303
 
304
 
305
        /*write any value to VIC0 VAR*/  
306
        VIC0->VAR = 0xFF;
1 ingob 307
}
308
/*******************************************************************************
309
* Function Name  : CAN_IRQHandler
310
* Description    : This function handles the CAN interrupt request
311
*******************************************************************************/
312
void CAN_IRQHandler(void)
313
{
41 ingob 314
        /*write your handler here*/
315
        /* ... */
316
 
317
 
318
        /*write any value to VIC0 VAR*/  
319
        VIC0->VAR = 0xFF;
1 ingob 320
}
321
/*******************************************************************************
322
* Function Name  : MC_IRQHandler
323
* Description    : This function handles the MC interrupt request
324
*******************************************************************************/
325
void MC_IRQHandler(void)
326
{
41 ingob 327
        /*write your handler here*/
328
        /* ... */
329
 
330
 
331
        /*write any value to VIC0 VAR*/  
332
        VIC0->VAR = 0xFF;
1 ingob 333
}
334
/*******************************************************************************
335
* Function Name  : ADC_IRQHandler
336
* Description    : This function handles the ADC interrupt request
337
*******************************************************************************/
338
void ADC_IRQHandler(void)
339
{
41 ingob 340
        /*write your handler here*/
341
        /* ... */
342
 
343
 
344
        /*write any value to VIC0 VAR*/  
345
        VIC0->VAR = 0xFF;
1 ingob 346
}
347
/*******************************************************************************
348
* Function Name  : UART0_IRQHandler
349
* Description    : This function handles the UART0 interrupt request
350
*******************************************************************************/
351
/*void UART0_IRQHandler(void)
352
{
353
} */
354
/*******************************************************************************
355
* Function Name  : UART1_IRQHandler
356
* Description    : This function handles the UART1 interrupt request
357
*******************************************************************************/
358
/*void UART1_IRQHandler(void)
41 ingob 359
{      
360
} */
1 ingob 361
/*******************************************************************************
362
* Function Name  : UART2_IRQHandler
363
* Description    : This function handles the UART2 interrupt request
364
*******************************************************************************/
41 ingob 365
/*void UART2_IRQHandler(void)
1 ingob 366
{
41 ingob 367
} */
1 ingob 368
/*******************************************************************************
369
* Function Name  : I2C0_IRQHandler
370
* Description    : This function handles the I2C0 interrupt request
371
*******************************************************************************/
372
void I2C0_IRQHandler(void)
373
{
374
}
375
/*******************************************************************************
376
* Function Name  : I2C1_IRQHandler
377
* Description    : This function handles the I2C1 interrupt request
378
*******************************************************************************/
379
/*void I2C1_IRQHandler(void)
380
{
381
} */
382
/*******************************************************************************
383
* Function Name  : SSP0_IRQHandler
384
* Description    : This function handles the SSP0 interrupt request
385
*******************************************************************************/
386
/*void SSP0_IRQHandler(void)
387
{
388
} */
389
/*******************************************************************************
390
* Function Name  : SSP1_IRQHandler
391
* Description    : This function handles the SSP1 interrupt request
392
*******************************************************************************/
393
void SSP1_IRQHandler(void)
394
{
395
}
396
/*******************************************************************************
397
* Function Name  : LVD_IRQHandler
398
* Description    : This function handles the LVD interrupt request
399
*******************************************************************************/
400
void LVD_IRQHandler(void)
401
{
402
}
403
/*******************************************************************************
404
* Function Name  : RTC_IRQHandler
405
* Description    : This function handles the RTC interrupt request
406
*******************************************************************************/
407
void RTC_IRQHandler(void)
408
{
409
}
410
/*******************************************************************************
411
* Function Name  : WIU_IRQHandler
412
* Description    : This function handles the WIU interrupt request
413
*******************************************************************************/
414
void WIU_IRQHandler(void)
415
{
416
}
417
/*******************************************************************************
418
* Function Name  : EXTIT0_IRQHandler
419
* Description    : This function handles the EXTIT0 interrupt request
420
*******************************************************************************/
421
void EXTIT0_IRQHandler(void)
422
{
423
}
424
/*******************************************************************************
425
* Function Name  : EXTIT1_IRQHandler
426
* Description    : This function handles the EXTIT1 interrupt request
427
*******************************************************************************/
41 ingob 428
void EXTIT1_IRQHandler(void)
1 ingob 429
{
24 StephanB 430
        VIC_ITCmd(EXTIT1_ITLine, DISABLE);
431
        if(WIU_GetITStatus(WIU_Line11) != RESET)
432
        {
433
                BeepTime = 100;
41 ingob 434
                Fat16_Init(); // initialize sd-card file system.
24 StephanB 435
 
436
                WIU_ClearFlag(WIU_Line1);
437
                WIU_ClearITPendingBit(WIU_Line11);
438
        }
439
        VIC_ITCmd(EXTIT1_ITLine, ENABLE);
1 ingob 440
}
441
/*******************************************************************************
442
* Function Name  : EXTIT2_IRQHandler
443
* Description    : This function handles the EXTIT2 interrupt request
444
*******************************************************************************/
445
void EXTIT2_IRQHandler(void)
446
{
447
}
448
/*******************************************************************************
449
* Function Name  : EXTIT3_IRQHandler
450
* Description    : This function handles the EXTIT3 interrupt request
451
*******************************************************************************/
452
void EXTIT3_IRQHandler(void)
453
{
454
}
455
/*******************************************************************************
456
* Function Name  : USBWU_IRQHandler
457
* Description    : This function handles the USBWU interrupt request
458
*******************************************************************************/
459
void USBWU_IRQHandler(void)
460
{
461
}
462
/*******************************************************************************
463
* Function Name  : PFQBC_IRQHandler
464
* Description    : This function handles the PFQBC interrupt request
465
*******************************************************************************/
466
void PFQBC_IRQHandler(void)
467
{
468
}
469