Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/PWR/STOP/stm32f10x_it.c @ 0:c59513fd84fb
Initial commit of STM32 test code.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Mon, 03 Oct 2011 21:19:15 +1030 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c59513fd84fb |
---|---|
1 /** | |
2 ****************************************************************************** | |
3 * @file PWR/STOP/stm32f10x_it.c | |
4 * @author MCD Application Team | |
5 * @version V3.5.0 | |
6 * @date 08-April-2011 | |
7 * @brief Main Interrupt Service Routines. | |
8 * This file provides template for all exceptions handler and peripherals | |
9 * interrupt service routine. | |
10 ****************************************************************************** | |
11 * @attention | |
12 * | |
13 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS | |
14 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE | |
15 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY | |
16 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING | |
17 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE | |
18 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. | |
19 * | |
20 * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> | |
21 ****************************************************************************** | |
22 */ | |
23 | |
24 /* Includes ------------------------------------------------------------------*/ | |
25 #include "stm32f10x_it.h" | |
26 #include "stm32_eval.h" | |
27 | |
28 /** @addtogroup STM32F10x_StdPeriph_Examples | |
29 * @{ | |
30 */ | |
31 | |
32 /** @addtogroup PWR_STOP | |
33 * @{ | |
34 */ | |
35 | |
36 /* Private typedef -----------------------------------------------------------*/ | |
37 /* Private define ------------------------------------------------------------*/ | |
38 /* Private macro -------------------------------------------------------------*/ | |
39 /* Private variables ---------------------------------------------------------*/ | |
40 __IO uint32_t TimingDelay = 0; | |
41 | |
42 /* Private function prototypes -----------------------------------------------*/ | |
43 /* Private functions ---------------------------------------------------------*/ | |
44 | |
45 /******************************************************************************/ | |
46 /* Cortex-M3 Processor Exceptions Handlers */ | |
47 /******************************************************************************/ | |
48 | |
49 /** | |
50 * @brief This function handles NMI exception. | |
51 * @param None | |
52 * @retval None | |
53 */ | |
54 void NMI_Handler(void) | |
55 { | |
56 } | |
57 | |
58 /** | |
59 * @brief This function handles Hard Fault exception. | |
60 * @param None | |
61 * @retval None | |
62 */ | |
63 void HardFault_Handler(void) | |
64 { | |
65 /* Go to infinite loop when Hard Fault exception occurs */ | |
66 while (1) | |
67 { | |
68 } | |
69 } | |
70 | |
71 /** | |
72 * @brief This function handles Memory Manage exception. | |
73 * @param None | |
74 * @retval None | |
75 */ | |
76 void MemManage_Handler(void) | |
77 { | |
78 /* Go to infinite loop when Memory Manage exception occurs */ | |
79 while (1) | |
80 { | |
81 } | |
82 } | |
83 | |
84 /** | |
85 * @brief This function handles Bus Fault exception. | |
86 * @param None | |
87 * @retval None | |
88 */ | |
89 void BusFault_Handler(void) | |
90 { | |
91 /* Go to infinite loop when Bus Fault exception occurs */ | |
92 while (1) | |
93 { | |
94 } | |
95 } | |
96 | |
97 /** | |
98 * @brief This function handles Usage Fault exception. | |
99 * @param None | |
100 * @retval None | |
101 */ | |
102 void UsageFault_Handler(void) | |
103 { | |
104 /* Go to infinite loop when Usage Fault exception occurs */ | |
105 while (1) | |
106 { | |
107 } | |
108 } | |
109 | |
110 /** | |
111 * @brief This function handles SVCall exception. | |
112 * @param None | |
113 * @retval None | |
114 */ | |
115 void SVC_Handler(void) | |
116 { | |
117 } | |
118 | |
119 /** | |
120 * @brief This function handles Debug Monitor exception. | |
121 * @param None | |
122 * @retval None | |
123 */ | |
124 void DebugMon_Handler(void) | |
125 { | |
126 } | |
127 | |
128 /** | |
129 * @brief This function handles PendSV_Handler exception. | |
130 * @param None | |
131 * @retval None | |
132 */ | |
133 void PendSV_Handler(void) | |
134 { | |
135 } | |
136 | |
137 /** | |
138 * @brief This function handles SysTick Handler. | |
139 * @param None | |
140 * @retval None | |
141 */ | |
142 void SysTick_Handler(void) | |
143 { | |
144 TimingDelay--; | |
145 } | |
146 | |
147 /******************************************************************************/ | |
148 /* STM32F10x Peripherals Interrupt Handlers */ | |
149 /******************************************************************************/ | |
150 | |
151 /** | |
152 * @brief This function handles External lines 9 to 5 interrupt request. | |
153 * @param None | |
154 * @retval None | |
155 */ | |
156 void EXTI9_5_IRQHandler(void) | |
157 { | |
158 if(EXTI_GetITStatus(KEY_BUTTON_EXTI_LINE) != RESET) | |
159 { | |
160 /* Clear the Key Button EXTI line pending bit */ | |
161 EXTI_ClearITPendingBit(KEY_BUTTON_EXTI_LINE); | |
162 | |
163 /* Toggle LED2 */ | |
164 STM_EVAL_LEDToggle(LED2); | |
165 } | |
166 } | |
167 | |
168 /** | |
169 * @brief This function handles RTC Alarm interrupt request. | |
170 * @param None | |
171 * @retval None | |
172 */ | |
173 void RTCAlarm_IRQHandler(void) | |
174 { | |
175 if(RTC_GetITStatus(RTC_IT_ALR) != RESET) | |
176 { | |
177 /* Toggle LED3 */ | |
178 STM_EVAL_LEDToggle(LED3); | |
179 | |
180 /* Clear EXTI line17 pending bit */ | |
181 EXTI_ClearITPendingBit(EXTI_Line17); | |
182 | |
183 /* Check if the Wake-Up flag is set */ | |
184 if(PWR_GetFlagStatus(PWR_FLAG_WU) != RESET) | |
185 { | |
186 /* Clear Wake Up flag */ | |
187 PWR_ClearFlag(PWR_FLAG_WU); | |
188 } | |
189 | |
190 /* Wait until last write operation on RTC registers has finished */ | |
191 RTC_WaitForLastTask(); | |
192 /* Clear RTC Alarm interrupt pending bit */ | |
193 RTC_ClearITPendingBit(RTC_IT_ALR); | |
194 /* Wait until last write operation on RTC registers has finished */ | |
195 RTC_WaitForLastTask(); | |
196 } | |
197 } | |
198 | |
199 /******************************************************************************/ | |
200 /* STM32F10x Peripherals Interrupt Handlers */ | |
201 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ | |
202 /* available peripheral interrupt handler's name please refer to the startup */ | |
203 /* file (startup_stm32f10x_xx.s). */ | |
204 /******************************************************************************/ | |
205 | |
206 /** | |
207 * @brief This function handles PPP interrupt request. | |
208 * @param None | |
209 * @retval None | |
210 */ | |
211 /*void PPP_IRQHandler(void) | |
212 { | |
213 }*/ | |
214 | |
215 /** | |
216 * @} | |
217 */ | |
218 | |
219 /** | |
220 * @} | |
221 */ | |
222 | |
223 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ |