STM32F0xx Standard Peripherals Firmware Library: stm32f0xx_it.c Source File

STM32F0xx Standard Peripherals Library

STM32F0xx_StdPeriph_Examples/RTC/RTC_StopWatch/stm32f0xx_it.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    RTC/RTC_StopWatch/stm32f0xx_it.c 
00004   * @author  MCD Application Team
00005   * @version V1.4.0
00006   * @date    24-July-2014
00007   * @brief   Main Interrupt Service Routines.
00008   *          This file provides template for all exceptions handler and 
00009   *          peripherals interrupt service routine.
00010   ******************************************************************************
00011   * @attention
00012   *
00013   * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
00014   *
00015   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
00016   * You may not use this file except in compliance with the License.
00017   * You may obtain a copy of the License at:
00018   *
00019   *        http://www.st.com/software_license_agreement_liberty_v2
00020   *
00021   * Unless required by applicable law or agreed to in writing, software 
00022   * distributed under the License is distributed on an "AS IS" BASIS, 
00023   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00024   * See the License for the specific language governing permissions and
00025   * limitations under the License.
00026   *
00027   ******************************************************************************
00028   */
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f0xx_it.h"
00032 
00033 /** @addtogroup STM32F0xx_StdPeriph_Examples
00034   * @{
00035   */
00036 
00037 /** @addtogroup RTC_StopWatch
00038   * @{
00039   */
00040 
00041 /* Private typedef -----------------------------------------------------------*/
00042 /* Private define ------------------------------------------------------------*/
00043 /* Private macro -------------------------------------------------------------*/
00044 /* Private variables ---------------------------------------------------------*/
00045 extern __IO uint8_t Button_State;
00046 extern __IO uint8_t Button_RTC;
00047 extern __IO uint8_t StartEvent;
00048 extern uint32_t BackupIndex;
00049 /* Private function prototypes -----------------------------------------------*/
00050 /* Private functions ---------------------------------------------------------*/
00051 
00052 /******************************************************************************/
00053 /*            Cortex-M0 Processor Exceptions Handlers                         */
00054 /******************************************************************************/
00055 
00056 /**
00057   * @brief  This function handles NMI exception.
00058   * @param  None
00059   * @retval None
00060   */
00061 void NMI_Handler(void)
00062 {
00063 }
00064 
00065 /**
00066   * @brief  This function handles Hard Fault exception.
00067   * @param  None
00068   * @retval None
00069   */
00070 void HardFault_Handler(void)
00071 {
00072   /* Go to infinite loop when Hard Fault exception occurs */
00073   while (1)
00074   {
00075   }
00076 }
00077 
00078 /**
00079   * @brief  This function handles SVCall exception.
00080   * @param  None
00081   * @retval None
00082   */
00083 void SVC_Handler(void)
00084 {
00085 }
00086 
00087 /**
00088   * @brief  This function handles PendSVC exception.
00089   * @param  None
00090   * @retval None
00091   */
00092 void PendSV_Handler(void)
00093 {
00094 }
00095 
00096 /**
00097   * @brief  This function handles SysTick Handler.
00098   * @param  None
00099   * @retval None
00100   */
00101 void SysTick_Handler(void)
00102 {
00103 }
00104 
00105 /******************************************************************************/
00106 /*                 STM32F0xx Peripherals Interrupt Handlers                   */
00107 /******************************************************************************/
00108 #ifdef USE_STM320518_EVAL
00109 /**
00110 * @brief  This function handles External lines 15 to 4 interrupt request.
00111 * @param  None
00112 * @retval None
00113 */
00114 void EXTI4_15_IRQHandler(void)
00115 {
00116   if((EXTI_GetITStatus(LEFT_BUTTON_EXTI_LINE) != RESET) && (StartEvent == 0x0))
00117     {
00118       Button_State = LEFT_ON;
00119     }
00120     
00121     else if((EXTI_GetITStatus(RIGHT_BUTTON_EXTI_LINE) != RESET) && (StartEvent !=0x0) && (BackupIndex < 11))
00122     {
00123       Button_State = RIGHT_ON;
00124     }
00125         /* Clear the LEFT EXTI  pending bit */
00126       EXTI_ClearITPendingBit(LEFT_BUTTON_EXTI_LINE);  
00127         /* Clear the RIGHT EXTI line */
00128       EXTI_ClearITPendingBit(RIGHT_BUTTON_EXTI_LINE);  
00129 }
00130 #else 
00131 /**
00132 * @brief  This function handles External lines 3 to 2 interrupt request.
00133 * @param  None
00134 * @retval None
00135 */
00136 void EXTI2_3_IRQHandler(void)
00137 {
00138   if((EXTI_GetITStatus(LEFT_BUTTON_EXTI_LINE) != RESET) && (StartEvent == 0x0))
00139     {
00140       Button_State = LEFT_ON;
00141     }
00142     
00143     else if((EXTI_GetITStatus(RIGHT_BUTTON_EXTI_LINE) != RESET) && (StartEvent !=0x0) && (BackupIndex < 11))
00144     {
00145       Button_State = RIGHT_ON;
00146     }
00147         /* Clear the LEFT EXTI  pending bit */
00148       EXTI_ClearITPendingBit(LEFT_BUTTON_EXTI_LINE);  
00149         /* Clear the RIGHT EXTI line */
00150       EXTI_ClearITPendingBit(RIGHT_BUTTON_EXTI_LINE);  
00151 }
00152 #endif /* USE_STM320518_EVAL */
00153 
00154 
00155 /**
00156 * @brief  This function handles Tamper pin interrupt request.
00157 * @param  None
00158 * @retval None
00159 */
00160 void RTC_IRQHandler(void)
00161 {
00162   if (RTC_GetITStatus(RTC_IT_TAMP1) != RESET)
00163   {
00164     Button_RTC = RTC_TAMP;
00165   }
00166   /* Clear EXTI line 19 */
00167   EXTI_ClearITPendingBit(EXTI_Line19);
00168   /* Clear Tamper pin interrupt pending bit */
00169   RTC_ClearITPendingBit(RTC_IT_TAMP1);
00170 }
00171 /******************************************************************************/
00172 /*                 STM32F0xx Peripherals Interrupt Handlers                   */
00173 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00174 /*  available peripheral interrupt handler's name please refer to the startup */
00175 /*  file (startup_stm32f0xx.s).                                               */
00176 /******************************************************************************/
00177 
00178 /**
00179   * @brief  This function handles PPP interrupt request.
00180   * @param  None
00181   * @retval None
00182   */
00183 /*void PPP_IRQHandler(void)
00184 {
00185 }*/
00186 
00187 /**
00188   * @}
00189   */
00190 
00191 /**
00192   * @}
00193   */
00194 
00195 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32