]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M4F_ATSAM4E_Atmel_Studio/src/ASF/sam/utils/cmsis/sam4e/source/templates/exceptions.c
Update copyright date ready for tagging V10.1.0.
[freertos] / FreeRTOS / Demo / CORTEX_M4F_ATSAM4E_Atmel_Studio / src / ASF / sam / utils / cmsis / sam4e / source / templates / exceptions.c
1 /**\r
2  * \file\r
3  *\r
4  * \brief This file contains the default exception handlers.\r
5  *\r
6  * Copyright (c) 2012 Atmel Corporation. All rights reserved.\r
7  *\r
8  * \asf_license_start\r
9  *\r
10  * \page License\r
11  *\r
12  * Redistribution and use in source and binary forms, with or without\r
13  * modification, are permitted provided that the following conditions are met:\r
14  *\r
15  * 1. Redistributions of source code must retain the above copyright notice,\r
16  *    this list of conditions and the following disclaimer.\r
17  *\r
18  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
19  *    this list of conditions and the following disclaimer in the documentation\r
20  *    and/or other materials provided with the distribution.\r
21  *\r
22  * 3. The name of Atmel may not be used to endorse or promote products derived\r
23  *    from this software without specific prior written permission.\r
24  *\r
25  * 4. This software may only be redistributed and used in connection with an\r
26  *    Atmel microcontroller product.\r
27  *\r
28  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
29  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
31  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
32  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r
36  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
37  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
38  * POSSIBILITY OF SUCH DAMAGE.\r
39  *\r
40  * \asf_license_stop\r
41  *\r
42  * \par Purpose\r
43  *\r
44  * This file provides basic support for Cortex-M processor based\r
45  * microcontrollers.\r
46  *\r
47  * \note\r
48  * The exception handler has weak aliases.\r
49  * As they are weak aliases, any function with the same name will override\r
50  * this definition.\r
51  *\r
52  */\r
53 \r
54 #include "exceptions.h"\r
55 \r
56 /* @cond 0 */\r
57 /**INDENT-OFF**/\r
58 #ifdef __cplusplus\r
59 extern "C" {\r
60 #endif\r
61 /**INDENT-ON**/\r
62 /* @endcond */\r
63 \r
64 #ifdef __GNUC__\r
65 void Dummy_Hardfault_Handler( void );\r
66 /* Cortex-M4 core handlers */\r
67 void Reset_Handler      (void  ) __attribute__ ((weak, alias("Dummy_Handler")));\r
68 void NMI_Handler        ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
69 void HardFault_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Hardfault_Handler")));\r
70 void MemManage_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
71 void BusFault_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
72 void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
73 void SVC_Handler        ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
74 void DebugMon_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
75 void PendSV_Handler     ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
76 void SysTick_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
77 \r
78 /* Peripherals handlers */\r
79 void SUPC_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
80 void RSTC_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
81 void RTC_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
82 void RTT_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
83 void WDT_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
84 void PMC_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
85 void EFC_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
86 void UART0_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
87 void SMC_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
88 void PIOA_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
89 void PIOB_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
90 void PIOC_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
91 void PIOD_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
92 void PIOE_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
93 void USART0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
94 void USART1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
95 void HSMCI_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
96 void TWI0_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
97 void TWI1_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
98 void SPI_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
99 void DMAC_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
100 void TC0_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
101 void TC1_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
102 void TC2_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
103 void TC3_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
104 void TC4_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
105 void TC5_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
106 void TC6_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
107 void TC7_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
108 void TC8_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
109 void AFEC0_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
110 void AFEC1_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
111 void DACC_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
112 void ACC_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
113 void ARM_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
114 void UDP_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
115 void PWM_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
116 void CAN0_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
117 void CAN1_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
118 void AES_Handler    ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
119 void GMAC_Handler   ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
120 void UART1_Handler  ( void ) __attribute__ ((weak, alias("Dummy_Handler")));\r
121 #endif /* __GNUC__ */\r
122 \r
123 #ifdef __ICCARM__\r
124 /* Cortex-M4 core handlers */\r
125 #pragma weak Reset_Handler=Dummy_Handler\r
126 #pragma weak NMI_Handler=Dummy_Handler\r
127 #pragma weak HardFault_Handler=Dummy_Handler\r
128 #pragma weak MemManage_Handler=Dummy_Handler\r
129 #pragma weak BusFault_Handler=Dummy_Handler\r
130 #pragma weak UsageFault_Handler=Dummy_Handler\r
131 #pragma weak SVC_Handler=Dummy_Handler\r
132 #pragma weak DebugMon_Handler=Dummy_Handler\r
133 #pragma weak PendSV_Handler=Dummy_Handler\r
134 #pragma weak SysTick_Handler=Dummy_Handler\r
135 \r
136 /* Peripherals handlers */\r
137 #pragma weak SUPC_Handler=Dummy_Handler\r
138 #pragma weak RSTC_Handler=Dummy_Handler\r
139 #pragma weak RTC_Handler=Dummy_Handler\r
140 #pragma weak RTT_Handler=Dummy_Handler\r
141 #pragma weak WDT_Handler=Dummy_Handler\r
142 #pragma weak PMC_Handler=Dummy_Handler\r
143 #pragma weak EFC_Handler=Dummy_Handler\r
144 #pragma weak UART0_Handler=Dummy_Handler\r
145 #pragma weak SMC_Handler=Dummy_Handler\r
146 #pragma weak PIOA_Handler=Dummy_Handler\r
147 #pragma weak PIOB_Handler=Dummy_Handler\r
148 #pragma weak PIOC_Handler=Dummy_Handler\r
149 #pragma weak PIOD_Handler=Dummy_Handler\r
150 #pragma weak PIOE_Handler=Dummy_Handler\r
151 #pragma weak USART0_Handler=Dummy_Handler\r
152 #pragma weak USART1_Handler=Dummy_Handler\r
153 #pragma weak HSMCI_Handler=Dummy_Handler\r
154 #pragma weak TWI0_Handler=Dummy_Handler\r
155 #pragma weak TWI1_Handler=Dummy_Handler\r
156 #pragma weak SPI_Handler=Dummy_Handler\r
157 #pragma weak DMAC_Handler=Dummy_Handler\r
158 #pragma weak TC0_Handler=Dummy_Handler\r
159 #pragma weak TC1_Handler=Dummy_Handler\r
160 #pragma weak TC2_Handler=Dummy_Handler\r
161 #pragma weak TC3_Handler=Dummy_Handler\r
162 #pragma weak TC4_Handler=Dummy_Handler\r
163 #pragma weak TC5_Handler=Dummy_Handler\r
164 #pragma weak TC6_Handler=Dummy_Handler\r
165 #pragma weak TC7_Handler=Dummy_Handler\r
166 #pragma weak TC8_Handler=Dummy_Handler\r
167 #pragma weak AFEC0_Handler=Dummy_Handler\r
168 #pragma weak AFEC1_Handler=Dummy_Handler\r
169 #pragma weak DACC_Handler=Dummy_Handler\r
170 #pragma weak ACC_Handler=Dummy_Handler\r
171 #pragma weak ARM_Handler=Dummy_Handler\r
172 #pragma weak UDP_Handler=Dummy_Handler\r
173 #pragma weak PWM_Handler=Dummy_Handler\r
174 #pragma weak CAN0_Handler=Dummy_Handler\r
175 #pragma weak CAN1_Handler=Dummy_Handler\r
176 #pragma weak AES_Handler=Dummy_Handler\r
177 #pragma weak GMAC_Handler=Dummy_Handler\r
178 #pragma weak UART1_Handler=Dummy_Handler\r
179 #endif /* __ICCARM__ */\r
180 \r
181 /**\r
182  * \brief Default interrupt handler for unused IRQs.\r
183  */\r
184 void Dummy_Handler(void)\r
185 {\r
186         while (1) {\r
187         }\r
188 }\r
189 \r
190 void Dummy_Hardfault_Handler(void)\r
191 {\r
192         while (1) {\r
193         }\r
194 }\r
195 \r
196 /* @cond 0 */\r
197 /**INDENT-OFF**/\r
198 #ifdef __cplusplus\r
199 }\r
200 #endif\r
201 /**INDENT-ON**/\r
202 /* @endcond */\r