1
0

stm32f10x_it.c 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /**
  2. ******************************************************************************
  3. * @file Project/STM32F10x_StdPeriph_Template/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
  9. * peripherals 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>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  21. ******************************************************************************
  22. */
  23. /* Includes ------------------------------------------------------------------*/
  24. #include "stm32f10x_it.h"
  25. #include <board.h>
  26. #include <rtthread.h>
  27. /** @addtogroup Template_Project
  28. * @{
  29. */
  30. /* Private typedef -----------------------------------------------------------*/
  31. /* Private define ------------------------------------------------------------*/
  32. /* Private macro -------------------------------------------------------------*/
  33. /* Private variables ---------------------------------------------------------*/
  34. /* Private function prototypes -----------------------------------------------*/
  35. /* Private functions ---------------------------------------------------------*/
  36. /******************************************************************************/
  37. /* Cortex-M3 Processor Exceptions Handlers */
  38. /******************************************************************************/
  39. /**
  40. * @brief This function handles NMI exception.
  41. * @param None
  42. * @retval None
  43. */
  44. void NMI_Handler(void)
  45. {
  46. }
  47. /**
  48. * @brief This function handles Memory Manage exception.
  49. * @param None
  50. * @retval None
  51. */
  52. void MemManage_Handler(void)
  53. {
  54. /* Go to infinite loop when Memory Manage exception occurs */
  55. while (1)
  56. {
  57. }
  58. }
  59. /**
  60. * @brief This function handles Bus Fault exception.
  61. * @param None
  62. * @retval None
  63. */
  64. void BusFault_Handler(void)
  65. {
  66. /* Go to infinite loop when Bus Fault exception occurs */
  67. while (1)
  68. {
  69. }
  70. }
  71. /**
  72. * @brief This function handles Usage Fault exception.
  73. * @param None
  74. * @retval None
  75. */
  76. void UsageFault_Handler(void)
  77. {
  78. /* Go to infinite loop when Usage Fault exception occurs */
  79. while (1)
  80. {
  81. }
  82. }
  83. /**
  84. * @brief This function handles SVCall exception.
  85. * @param None
  86. * @retval None
  87. */
  88. void SVC_Handler(void)
  89. {
  90. }
  91. /**
  92. * @brief This function handles Debug Monitor exception.
  93. * @param None
  94. * @retval None
  95. */
  96. void DebugMon_Handler(void)
  97. {
  98. }
  99. void SysTick_Handler(void)
  100. {
  101. extern void rt_hw_timer_handler(void);
  102. rt_hw_timer_handler();
  103. }
  104. /******************************************************************************/
  105. /* STM32F10x Peripherals Interrupt Handlers */
  106. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  107. /* available peripheral interrupt handler's name please refer to the startup */
  108. /* file (startup_stm32f10x_xx.s). */
  109. /******************************************************************************/
  110. /*******************************************************************************
  111. * Function Name : USART1_IRQHandler
  112. * Description : This function handles USART1 global interrupt request.
  113. * Input : None
  114. * Output : None
  115. * Return : None
  116. *******************************************************************************/
  117. void USART1_IRQHandler(void)
  118. {
  119. #ifdef RT_USING_UART1
  120. extern struct rt_device uart1_device;
  121. extern void rt_hw_serial_isr(struct rt_device *device);
  122. /* enter interrupt */
  123. rt_interrupt_enter();
  124. rt_hw_serial_isr(&uart1_device);
  125. /* leave interrupt */
  126. rt_interrupt_leave();
  127. #endif
  128. }
  129. /*******************************************************************************
  130. * Function Name : USART2_IRQHandler
  131. * Description : This function handles USART2 global interrupt request.
  132. * Input : None
  133. * Output : None
  134. * Return : None
  135. *******************************************************************************/
  136. void USART2_IRQHandler(void)
  137. {
  138. #ifdef RT_USING_UART2
  139. extern struct rt_device uart2_device;
  140. extern void rt_hw_serial_isr(struct rt_device *device);
  141. /* enter interrupt */
  142. rt_interrupt_enter();
  143. rt_hw_serial_isr(&uart2_device);
  144. /* leave interrupt */
  145. rt_interrupt_leave();
  146. #endif
  147. }
  148. /*******************************************************************************
  149. * Function Name : USART3_IRQHandler
  150. * Description : This function handles USART3 global interrupt request.
  151. * Input : None
  152. * Output : None
  153. * Return : None
  154. *******************************************************************************/
  155. void USART3_IRQHandler(void)
  156. {
  157. #ifdef RT_USING_UART3
  158. extern struct rt_device uart3_device;
  159. extern void rt_hw_serial_isr(struct rt_device *device);
  160. /* enter interrupt */
  161. rt_interrupt_enter();
  162. rt_hw_serial_isr(&uart3_device);
  163. /* leave interrupt */
  164. rt_interrupt_leave();
  165. #endif
  166. }
  167. /**
  168. * @}
  169. */
  170. /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/