stm32f10x_it.c 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. /**
  120. * @brief This function handles SysTick Handler.
  121. * @param None
  122. * @retval None
  123. */
  124. static int siSecCt=0;
  125. void SysTick_Handler(void)
  126. {
  127. sutMsg.Tick10ms=1;
  128. if(++siSecCt>=50){
  129. siSecCt=0;
  130. sutMsg.Tick500ms=1;
  131. }
  132. }
  133. /*******************************************************************************
  134. * Function Name : USART1_IRQHandler
  135. * Description : This function handles USART1 global interrupt request.
  136. * Input : None
  137. * Output : None
  138. * Return : None
  139. *******************************************************************************/
  140. void USART1_IRQHandler(void)
  141. {
  142. UART1RxTxISRHandler();
  143. }
  144. /*******************************************************************************
  145. * Function Name : USART2_IRQHandler
  146. * Description : This function handles USART1 global interrupt request.
  147. * Input : None
  148. * Output : None
  149. * Return : None
  150. *******************************************************************************/
  151. void USART2_IRQHandler(void)
  152. {
  153. UART2RxTxISRHandler(); /* Call uC/OS-II's OSTimeTick() */
  154. }
  155. /*******************************************************************************
  156. * Function Name : USART3_IRQHandler
  157. * Description : This function handles USART1 global interrupt request.
  158. * Input : None
  159. * Output : None
  160. * Return : None
  161. *******************************************************************************/
  162. void USART3_IRQHandler(void)
  163. {
  164. UART3RxTxISRHandler();
  165. }
  166. void DMA1_Channel2_IRQHandler(void)
  167. {
  168. }
  169. void DMA1_Channel4_IRQHandler(void)
  170. {
  171. }
  172. /******************************************************************************/
  173. /* STM32F10x Peripherals Interrupt Handlers */
  174. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  175. /* available peripheral interrupt handler's name please refer to the startup */
  176. /* file (startup_stm32f10x_xx.s). */
  177. /******************************************************************************/
  178. /**
  179. * @brief This function handles PPP interrupt request.
  180. * @param None
  181. * @retval None
  182. */
  183. /*void PPP_IRQHandler(void)
  184. {
  185. }*/
  186. /**
  187. * @}
  188. */
  189. /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/