1 |
580 |
jeremybenn |
/* ----------------------------------------------------------------------------
|
2 |
|
|
* ATMEL Microcontroller Software Support
|
3 |
|
|
* ----------------------------------------------------------------------------
|
4 |
|
|
* Copyright (c) 2008, Atmel Corporation
|
5 |
|
|
*
|
6 |
|
|
* All rights reserved.
|
7 |
|
|
*
|
8 |
|
|
* Redistribution and use in source and binary forms, with or without
|
9 |
|
|
* modification, are permitted provided that the following conditions are met:
|
10 |
|
|
*
|
11 |
|
|
* - Redistributions of source code must retain the above copyright notice,
|
12 |
|
|
* this list of conditions and the disclaimer below.
|
13 |
|
|
*
|
14 |
|
|
* Atmel's name may not be used to endorse or promote products derived from
|
15 |
|
|
* this software without specific prior written permission.
|
16 |
|
|
*
|
17 |
|
|
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
18 |
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
19 |
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
20 |
|
|
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
21 |
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22 |
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
23 |
|
|
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24 |
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25 |
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
26 |
|
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27 |
|
|
* ----------------------------------------------------------------------------
|
28 |
|
|
*/
|
29 |
|
|
|
30 |
|
|
/*
|
31 |
|
|
** This file contains the default exception handlers
|
32 |
|
|
** and exception table.
|
33 |
|
|
*/
|
34 |
|
|
|
35 |
|
|
//------------------------------------------------------------------------------
|
36 |
|
|
// Types
|
37 |
|
|
//------------------------------------------------------------------------------
|
38 |
|
|
|
39 |
|
|
/// Function prototype for exception table items - interrupt handler.
|
40 |
|
|
//typedef void( *IrqHandler )( void );
|
41 |
|
|
typedef void( *IntFunc )( void );
|
42 |
|
|
|
43 |
|
|
/// Weak attribute
|
44 |
|
|
|
45 |
|
|
#if defined ( __CC_ARM )
|
46 |
|
|
#define WEAK __attribute__ ((weak))
|
47 |
|
|
#elif defined ( __ICCARM__ )
|
48 |
|
|
#define WEAK __weak
|
49 |
|
|
#elif defined ( __GNUC__ )
|
50 |
|
|
#define WEAK __attribute__ ((weak))
|
51 |
|
|
#endif
|
52 |
|
|
|
53 |
|
|
//------------------------------------------------------------------------------
|
54 |
|
|
// Global functions
|
55 |
|
|
//------------------------------------------------------------------------------
|
56 |
|
|
|
57 |
|
|
//------------------------------------------------------------------------------
|
58 |
|
|
// Exception Handlers
|
59 |
|
|
//------------------------------------------------------------------------------
|
60 |
|
|
|
61 |
|
|
extern WEAK void NMI_Handler( void );
|
62 |
|
|
extern WEAK void HardFault_Handler( void );
|
63 |
|
|
extern WEAK void MemManage_Handler( void );
|
64 |
|
|
extern WEAK void BusFault_Handler( void );
|
65 |
|
|
extern WEAK void UsageFault_Handler( void );
|
66 |
|
|
extern WEAK void SVC_Handler( void );
|
67 |
|
|
extern WEAK void DebugMon_Handler( void );
|
68 |
|
|
extern WEAK void PendSV_Handler( void );
|
69 |
|
|
extern WEAK void SysTick_Handler( void );
|
70 |
|
|
void IrqHandlerNotUsed(void);
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
// System Controller
|
74 |
|
|
extern void SYS_IrqHandler(void);
|
75 |
|
|
// SUPPLY CONTROLLER
|
76 |
|
|
extern WEAK void SUPC_IrqHandler(void);
|
77 |
|
|
// RESET CONTROLLER
|
78 |
|
|
extern WEAK void RSTC_IrqHandler(void);
|
79 |
|
|
// REAL TIME CLOCK
|
80 |
|
|
extern WEAK void RTC_IrqHandler(void);
|
81 |
|
|
// REAL TIME TIMER
|
82 |
|
|
extern WEAK void RTT_IrqHandler(void);
|
83 |
|
|
// WATCHDOG TIMER
|
84 |
|
|
extern WEAK void WDT_IrqHandler(void);
|
85 |
|
|
// PMC
|
86 |
|
|
extern WEAK void PMC_IrqHandler(void);
|
87 |
|
|
// EFC0
|
88 |
|
|
extern WEAK void EFC0_IrqHandler(void);
|
89 |
|
|
// EFC1
|
90 |
|
|
extern WEAK void EFC1_IrqHandler(void);
|
91 |
|
|
// DBGU
|
92 |
|
|
extern WEAK void DBGU_IrqHandler(void);
|
93 |
|
|
// HSMC4
|
94 |
|
|
extern WEAK void HSMC4_IrqHandler(void);
|
95 |
|
|
// Parallel IO Controller A
|
96 |
|
|
extern WEAK void PIOA_IrqHandler(void);
|
97 |
|
|
// Parallel IO Controller B
|
98 |
|
|
extern WEAK void PIOB_IrqHandler(void);
|
99 |
|
|
// Parallel IO Controller C
|
100 |
|
|
extern WEAK void PIOC_IrqHandler(void);
|
101 |
|
|
// USART 0
|
102 |
|
|
extern WEAK void USART0_IrqHandler(void);
|
103 |
|
|
// USART 1
|
104 |
|
|
extern WEAK void USART1_IrqHandler(void);
|
105 |
|
|
// USART 2
|
106 |
|
|
extern WEAK void USART2_IrqHandler(void);
|
107 |
|
|
// USART 3
|
108 |
|
|
extern WEAK void USART3_IrqHandler(void);
|
109 |
|
|
// Multimedia Card Interface
|
110 |
|
|
extern WEAK void MCI0_IrqHandler(void);
|
111 |
|
|
// TWI 0
|
112 |
|
|
extern WEAK void TWI0_IrqHandler(void);
|
113 |
|
|
// TWI 1
|
114 |
|
|
extern WEAK void TWI1_IrqHandler(void);
|
115 |
|
|
// Serial Peripheral Interface 0
|
116 |
|
|
extern WEAK void SPI0_IrqHandler(void);
|
117 |
|
|
// Serial Synchronous Controller 0
|
118 |
|
|
extern WEAK void SSC0_IrqHandler(void);
|
119 |
|
|
// Timer Counter 0
|
120 |
|
|
extern WEAK void TC0_IrqHandler(void);
|
121 |
|
|
// Timer Counter 1
|
122 |
|
|
extern WEAK void TC1_IrqHandler(void);
|
123 |
|
|
// Timer Counter 2
|
124 |
|
|
extern WEAK void TC2_IrqHandler(void);
|
125 |
|
|
// PWM Controller
|
126 |
|
|
extern WEAK void PWM_IrqHandler(void);
|
127 |
|
|
// ADC controller0
|
128 |
|
|
extern WEAK void ADCC0_IrqHandler(void);
|
129 |
|
|
// ADC controller1
|
130 |
|
|
extern WEAK void ADCC1_IrqHandler(void);
|
131 |
|
|
// HDMA
|
132 |
|
|
extern WEAK void HDMA_IrqHandler(void);
|
133 |
|
|
// USB Device High Speed UDP_HS
|
134 |
|
|
extern WEAK void UDPD_IrqHandler(void);
|
135 |
|
|
|