Mercurial > ~darius > hgwebdir.cgi > stm32temp
comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/PWR/STANDBY/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/STANDBY/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_STANDBY | |
33 * @{ | |
34 */ | |
35 | |
36 /* Private typedef -----------------------------------------------------------*/ | |
37 /* Private define ------------------------------------------------------------*/ | |
38 /* Private macro -------------------------------------------------------------*/ | |
39 /* Private variables ---------------------------------------------------------*/ | |
40 /* Private function prototypes -----------------------------------------------*/ | |
41 /* Private functions ---------------------------------------------------------*/ | |
42 | |
43 /******************************************************************************/ | |
44 /* Cortex-M3 Processor Exceptions Handlers */ | |
45 /******************************************************************************/ | |
46 | |
47 /** | |
48 * @brief This function handles NMI exception. | |
49 * @param None | |
50 * @retval None | |
51 */ | |
52 void NMI_Handler(void) | |
53 { | |
54 } | |
55 | |
56 /** | |
57 * @brief This function handles Hard Fault exception. | |
58 * @param None | |
59 * @retval None | |
60 */ | |
61 void HardFault_Handler(void) | |
62 { | |
63 /* Go to infinite loop when Hard Fault exception occurs */ | |
64 while (1) | |
65 { | |
66 } | |
67 } | |
68 | |
69 /** | |
70 * @brief This function handles Memory Manage exception. | |
71 * @param None | |
72 * @retval None | |
73 */ | |
74 void MemManage_Handler(void) | |
75 { | |
76 /* Go to infinite loop when Memory Manage exception occurs */ | |
77 while (1) | |
78 { | |
79 } | |
80 } | |
81 | |
82 /** | |
83 * @brief This function handles Bus Fault exception. | |
84 * @param None | |
85 * @retval None | |
86 */ | |
87 void BusFault_Handler(void) | |
88 { | |
89 /* Go to infinite loop when Bus Fault exception occurs */ | |
90 while (1) | |
91 { | |
92 } | |
93 } | |
94 | |
95 /** | |
96 * @brief This function handles Usage Fault exception. | |
97 * @param None | |
98 * @retval None | |
99 */ | |
100 void UsageFault_Handler(void) | |
101 { | |
102 /* Go to infinite loop when Usage Fault exception occurs */ | |
103 while (1) | |
104 { | |
105 } | |
106 } | |
107 | |
108 /** | |
109 * @brief This function handles SVCall exception. | |
110 * @param None | |
111 * @retval None | |
112 */ | |
113 void SVC_Handler(void) | |
114 { | |
115 } | |
116 | |
117 /** | |
118 * @brief This function handles Debug Monitor exception. | |
119 * @param None | |
120 * @retval None | |
121 */ | |
122 void DebugMon_Handler(void) | |
123 { | |
124 } | |
125 | |
126 /** | |
127 * @brief This function handles PendSV_Handler exception. | |
128 * @param None | |
129 * @retval None | |
130 */ | |
131 void PendSV_Handler(void) | |
132 { | |
133 } | |
134 | |
135 /** | |
136 * @brief This function handles SysTick Handler. | |
137 * @param None | |
138 * @retval None | |
139 */ | |
140 void SysTick_Handler(void) | |
141 { | |
142 /* Toggle LED1 */ | |
143 STM_EVAL_LEDToggle(LED1); | |
144 } | |
145 | |
146 /******************************************************************************/ | |
147 /* STM32F10x Peripherals Interrupt Handlers */ | |
148 /******************************************************************************/ | |
149 | |
150 /** | |
151 * @brief This function handles External lines 9 to 5 interrupt request. | |
152 * @param None | |
153 * @retval None | |
154 */ | |
155 void EXTI9_5_IRQHandler(void) | |
156 { | |
157 if(EXTI_GetITStatus(KEY_BUTTON_EXTI_LINE) != RESET) | |
158 { | |
159 /* Clear the Key Button EXTI line pending bit */ | |
160 EXTI_ClearITPendingBit(KEY_BUTTON_EXTI_LINE); | |
161 | |
162 /* Turn on LED1 */ | |
163 STM_EVAL_LEDOn(LED1); | |
164 | |
165 /* Wait till RTC Second event occurs */ | |
166 RTC_ClearFlag(RTC_FLAG_SEC); | |
167 while(RTC_GetFlagStatus(RTC_FLAG_SEC) == RESET); | |
168 | |
169 /* Set the RTC Alarm after 3s */ | |
170 RTC_SetAlarm(RTC_GetCounter()+ 3); | |
171 /* Wait until last write operation on RTC registers has finished */ | |
172 RTC_WaitForLastTask(); | |
173 | |
174 /* Request to enter STANDBY mode (Wake Up flag is cleared in PWR_EnterSTANDBYMode function) */ | |
175 PWR_EnterSTANDBYMode(); | |
176 } | |
177 } | |
178 | |
179 /******************************************************************************/ | |
180 /* STM32F10x Peripherals Interrupt Handlers */ | |
181 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ | |
182 /* available peripheral interrupt handler's name please refer to the startup */ | |
183 /* file (startup_stm32f10x_xx.s). */ | |
184 /******************************************************************************/ | |
185 | |
186 /** | |
187 * @brief This function handles PPP interrupt request. | |
188 * @param None | |
189 * @retval None | |
190 */ | |
191 /*void PPP_IRQHandler(void) | |
192 { | |
193 }*/ | |
194 | |
195 /** | |
196 * @} | |
197 */ | |
198 | |
199 /** | |
200 * @} | |
201 */ | |
202 | |
203 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ |