STM32F10x_StdPeriph_Examples/RTC/LSI_Calib/stm32f10x_it.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    RTC/LSI_Calib/stm32f10x_it.c 
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   Main Interrupt Service Routines.
00008   *          This file provides template for all exceptions handler and peripherals
00009   *          interrupt service routine.
00010   ******************************************************************************
00011   * @copy
00012   *
00013   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00014   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00015   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00016   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00017   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00018   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00019   *
00020   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00021   */ 
00022 
00023 /* Includes ------------------------------------------------------------------*/
00024 #include "stm32f10x_it.h"
00025 #include "main.h" 
00026 
00027 /** @addtogroup STM32F10x_StdPeriph_Examples
00028   * @{
00029   */
00030 
00031 /** @addtogroup RTC_LSI_Calib
00032   * @{
00033   */ 
00034 
00035 /* Private typedef -----------------------------------------------------------*/
00036 /* Private define ------------------------------------------------------------*/
00037 /* Private macro -------------------------------------------------------------*/
00038 /* Private variables ---------------------------------------------------------*/
00039 uint16_t tmpCC4[2] = {0, 0};
00040 
00041 /* Private function prototypes -----------------------------------------------*/
00042 /* Private functions ---------------------------------------------------------*/
00043 
00044 /******************************************************************************/
00045 /*            Cortex-M3 Processor Exceptions Handlers                         */
00046 /******************************************************************************/
00047 
00048 /**
00049   * @brief  This function handles NMI exception.
00050   * @param  None
00051   * @retval None
00052   */
00053 void NMI_Handler(void)
00054 {
00055 }
00056 
00057 /**
00058   * @brief  This function handles Hard Fault exception.
00059   * @param  None
00060   * @retval None
00061   */
00062 void HardFault_Handler(void)
00063 {
00064   /* Go to infinite loop when Hard Fault exception occurs */
00065   while (1)
00066   {}
00067 }
00068 
00069 /**
00070   * @brief  This function handles Memory Manage exception.
00071   * @param  None
00072   * @retval None
00073   */
00074 void MemManage_Handler(void)
00075 {
00076   /* Go to infinite loop when Memory Manage exception occurs */
00077   while (1)
00078   {}
00079 }
00080 
00081 /**
00082   * @brief  This function handles Bus Fault exception.
00083   * @param  None
00084   * @retval None
00085   */
00086 void BusFault_Handler(void)
00087 {
00088   /* Go to infinite loop when Bus Fault exception occurs */
00089   while (1)
00090   {}
00091 }
00092 
00093 /**
00094   * @brief  This function handles Usage Fault exception.
00095   * @param  None
00096   * @retval None
00097   */
00098 void UsageFault_Handler(void)
00099 {
00100   /* Go to infinite loop when Usage Fault exception occurs */
00101   while (1)
00102   {}
00103 }
00104 
00105 /**
00106   * @brief  This function handles Debug Monitor exception.
00107   * @param  None
00108   * @retval None
00109   */
00110 void DebugMon_Handler(void)
00111 {
00112 }
00113 
00114 /**
00115   * @brief  This function handles SVCall exception.
00116   * @param  None
00117   * @retval None
00118   */
00119 void SVC_Handler(void)
00120 {
00121 }
00122 
00123 /**
00124   * @brief  This function handles PendSV_Handler exception.
00125   * @param  None
00126   * @retval None
00127   */
00128 void PendSV_Handler(void)
00129 {
00130 }
00131 
00132 /**
00133   * @brief  This function handles SysTick Handler.
00134   * @param  None
00135   * @retval None
00136   */
00137 void SysTick_Handler(void)
00138 {
00139 }
00140 
00141 /******************************************************************************/
00142 /*            STM32F10x Peripherals Interrupt Handlers                        */
00143 /******************************************************************************/
00144 
00145 /**
00146   * @brief  This function handles RTC global interrupt request.
00147   * @param  None
00148   * @retval None
00149   */
00150 void RTC_IRQHandler(void)
00151 {
00152   if (RTC_GetITStatus(RTC_IT_SEC) != RESET)
00153   {
00154     /* Toggle LED1 */
00155     STM_EVAL_LEDToggle(LED1);
00156 
00157     /* Clear Interrupt pending bit */
00158     RTC_ClearITPendingBit(RTC_FLAG_SEC);
00159   }
00160 }
00161 
00162 /**
00163   * @brief  This function handles TIM5 global interrupt request.
00164   * @param  None
00165   * @retval None
00166   */
00167 void TIM5_IRQHandler(void)
00168 {
00169   uint32_t tmp = 0; 
00170   
00171   if (TIM_GetITStatus(TIM5, TIM_IT_CC4) == SET)
00172   {
00173     tmpCC4[IncrementVar_OperationComplete()] = (uint16_t)(TIM5->CCR4);
00174 
00175     TIM_ClearITPendingBit(TIM5, TIM_IT_CC4);
00176 
00177     if (GetVar_OperationComplete() >= 2)
00178     {
00179       /* Compute the period length */
00180       tmp = (uint16_t)(tmpCC4[1] - tmpCC4[0] + 1);
00181       SetVar_PeriodValue(tmp);
00182 
00183       /* Disable the interrupt */
00184       TIM_ITConfig(TIM5, TIM_IT_CC4, DISABLE);
00185       TIM_Cmd(TIM5, DISABLE);
00186     }
00187   }
00188 }
00189 
00190 /******************************************************************************/
00191 /*                 STM32F10x Peripherals Interrupt Handlers                   */
00192 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00193 /*  available peripheral interrupt handler's name please refer to the startup */
00194 /*  file (startup_stm32f10x_xx.s).                                            */
00195 /******************************************************************************/
00196 
00197 /**
00198   * @brief  This function handles PPP interrupt request.
00199   * @param  None
00200   * @retval None
00201   */
00202 /*void PPP_IRQHandler(void)
00203 {
00204 }*/
00205 
00206 /**
00207   * @}
00208   */
00209 
00210 /**
00211   * @}
00212   */
00213 
00214 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32