stm32f10x_it.c 5.8 KB

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