stm32f10x_it.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /**
  2. ******************************************************************************
  3. * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.c
  4. * @author MCD Application Team
  5. * @version V3.4.0
  6. * @date 10/15/2010
  7. * @brief Main Interrupt Service Routines.
  8. * This file provides template for all exceptions handler and
  9. * peripherals interrupt service routine.
  10. ******************************************************************************
  11. * @copy
  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>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
  21. */
  22. /* Includes ------------------------------------------------------------------*/
  23. #include "includes.h"
  24. /* Private typedef -----------------------------------------------------------*/
  25. /* Private define ------------------------------------------------------------*/
  26. /* Private macro -------------------------------------------------------------*/
  27. /* Private variables ---------------------------------------------------------*/
  28. /* Private function prototypes -----------------------------------------------*/
  29. /* Private functions ---------------------------------------------------------*/
  30. /******************************************************************************/
  31. /* Cortex-M3 Processor Exceptions Handlers */
  32. /******************************************************************************/
  33. /**
  34. * @brief This function handles NMI exception.
  35. * @param None
  36. * @retval None
  37. */
  38. void NMI_Handler(void)
  39. {
  40. }
  41. /**
  42. * @brief This function handles Hard Fault exception.
  43. * @param None
  44. * @retval None
  45. */
  46. unsigned short g_HFH[4]={0,0,0,0};
  47. unsigned short g_HFHT;
  48. void SetHFH(int index,int v)
  49. {
  50. unsigned short V;
  51. if(index>=4 || index <0)return;
  52. if(v>=15 || v<0)return;
  53. V=v;
  54. V<<=(index*4);
  55. g_HFH[index]=V;
  56. }
  57. void HardFault_Handler(void)
  58. {
  59. /* Go to infinite loop when Hard Fault exception occurs */
  60. //printf("HardFault_Handler\r\n");
  61. g_HFHT= g_HFH[3] | g_HFH[2] | g_HFH[1] | g_HFH[0];
  62. printf("\r\n[HFH=%04x]\r\n",g_HFHT);
  63. while (1)
  64. {
  65. }
  66. }
  67. /**
  68. * @brief This function handles Memory Manage exception.
  69. * @param None
  70. * @retval None
  71. */
  72. void MemManage_Handler(void)
  73. {
  74. /* Go to infinite loop when Memory Manage exception occurs */
  75. while (1)
  76. {
  77. }
  78. }
  79. /**
  80. * @brief This function handles Bus Fault exception.
  81. * @param None
  82. * @retval None
  83. */
  84. void BusFault_Handler(void)
  85. {
  86. /* Go to infinite loop when Bus Fault exception occurs */
  87. while (1)
  88. {
  89. }
  90. }
  91. /**
  92. * @brief This function handles Usage Fault exception.
  93. * @param None
  94. * @retval None
  95. */
  96. void UsageFault_Handler(void)
  97. {
  98. /* Go to infinite loop when Usage Fault exception occurs */
  99. while (1)
  100. {
  101. }
  102. }
  103. /**
  104. * @brief This function handles SVCall exception.
  105. * @param None
  106. * @retval None
  107. */
  108. void SVC_Handler(void)
  109. {
  110. }
  111. /**
  112. * @brief This function handles Debug Monitor exception.
  113. * @param None
  114. * @retval None
  115. */
  116. void DebugMon_Handler(void)
  117. {
  118. }
  119. void TIM2_IRQHandler(void)
  120. {
  121. static char LcdCounter;
  122. while(TIM_GetFlagStatus(TIM2, TIM_FLAG_Update) != SET);
  123. TIM_ClearFlag(TIM2, TIM_FLAG_Update);
  124. if(!KeyLightFlag)return;//ϨÆÁ״̬
  125. if(!sutPocStatus.FirstLogined) return;
  126. LcdCounter++;
  127. if(LcdCounter>newPara.LcdPulse){
  128. LCD_BL_HIGH;
  129. if(LcdCounter==5)LcdCounter=0;
  130. }else{
  131. LCD_BL_LOW;
  132. }
  133. }
  134. /**
  135. * @brief This function handles SysTick Handler.
  136. * @param None
  137. * @retval None
  138. */
  139. void SysTick_Handler(void)
  140. {
  141. uSysTickUpdate();
  142. ptTimerTick();
  143. uTimerCall();
  144. }
  145. /*******************************************************************************
  146. * Function Name : USART1_IRQHandler
  147. * Description : This function handles USART1 global interrupt request.
  148. * Input : None
  149. * Output : None
  150. * Return : None
  151. *******************************************************************************/
  152. void USART1_IRQHandler(void)
  153. {
  154. UART1RxTxISRHandler();
  155. }
  156. /*******************************************************************************
  157. * Function Name : USART2_IRQHandler
  158. * Description : This function handles USART1 global interrupt request.
  159. * Input : None
  160. * Output : None
  161. * Return : None
  162. *******************************************************************************/
  163. void USART2_IRQHandler(void)
  164. {
  165. UART2RxTxISRHandler(); /* Call uC/OS-II's OSTimeTick() */
  166. }
  167. /*******************************************************************************
  168. * Function Name : USART3_IRQHandler
  169. * Description : This function handles USART1 global interrupt request.
  170. * Input : None
  171. * Output : None
  172. * Return : None
  173. *******************************************************************************/
  174. void USART3_IRQHandler(void)
  175. {
  176. UART3RxTxISRHandler();
  177. }
  178. void DMA1_Channel2_IRQHandler(void)
  179. {
  180. }
  181. void DMA1_Channel4_IRQHandler(void)
  182. {
  183. }
  184. /******************************************************************************/
  185. /* STM32F10x Peripherals Interrupt Handlers */
  186. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  187. /* available peripheral interrupt handler's name please refer to the startup */
  188. /* file (startup_stm32f10x_xx.s). */
  189. /******************************************************************************/
  190. /**
  191. * @brief This function handles PPP interrupt request.
  192. * @param None
  193. * @retval None
  194. */
  195. /*void PPP_IRQHandler(void)
  196. {
  197. }*/
  198. /**
  199. * @}
  200. */
  201. /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/