stm32f4xx_it.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /**
  2. ******************************************************************************
  3. * @file IO_Toggle/stm32f4xx_it.c
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 19-September-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 "stm32f4xx.h"
  25. #include <rtthread.h>
  26. #include "board.h"
  27. /** @addtogroup STM32F4_Discovery_Peripheral_Examples
  28. * @{
  29. */
  30. /** @addtogroup IO_Toggle
  31. * @{
  32. */
  33. /* Private typedef -----------------------------------------------------------*/
  34. /* Private define ------------------------------------------------------------*/
  35. /* Private macro -------------------------------------------------------------*/
  36. /* Private variables ---------------------------------------------------------*/
  37. /* Private function prototypes -----------------------------------------------*/
  38. /* Private functions ---------------------------------------------------------*/
  39. /******************************************************************************/
  40. /* Cortex-M4 Processor Exceptions Handlers */
  41. /******************************************************************************/
  42. /**
  43. * @brief This function handles NMI exception.
  44. * @param None
  45. * @retval None
  46. */
  47. void NMI_Handler(void)
  48. {
  49. }
  50. /**
  51. * @brief This function handles Hard Fault exception.
  52. * @param None
  53. * @retval None
  54. */
  55. //void HardFault_Handler(void)
  56. //{
  57. // // definition in libcpu/arm/cortex-m4/context_*.S
  58. //}
  59. /**
  60. * @brief This function handles Memory Manage exception.
  61. * @param None
  62. * @retval None
  63. */
  64. void MemManage_Handler(void)
  65. {
  66. /* Go to infinite loop when Memory Manage exception occurs */
  67. while (1)
  68. {
  69. }
  70. }
  71. /**
  72. * @brief This function handles Bus Fault exception.
  73. * @param None
  74. * @retval None
  75. */
  76. void BusFault_Handler(void)
  77. {
  78. /* Go to infinite loop when Bus Fault exception occurs */
  79. while (1)
  80. {
  81. }
  82. }
  83. /**
  84. * @brief This function handles Usage Fault exception.
  85. * @param None
  86. * @retval None
  87. */
  88. void UsageFault_Handler(void)
  89. {
  90. /* Go to infinite loop when Usage Fault exception occurs */
  91. while (1)
  92. {
  93. }
  94. }
  95. /**
  96. * @brief This function handles SVCall exception.
  97. * @param None
  98. * @retval None
  99. */
  100. void SVC_Handler(void)
  101. {
  102. }
  103. /**
  104. * @brief This function handles Debug Monitor exception.
  105. * @param None
  106. * @retval None
  107. */
  108. void DebugMon_Handler(void)
  109. {
  110. }
  111. /**
  112. * @brief This function handles PendSVC exception.
  113. * @param None
  114. * @retval None
  115. */
  116. //void PendSV_Handler(void)
  117. //{
  118. // // definition in libcpu/arm/cortex-m4/context_*.S
  119. //}
  120. /**
  121. * @brief This function handles SysTick Handler.
  122. * @param None
  123. * @retval None
  124. */
  125. //void SysTick_Handler(void)
  126. //{
  127. // // definition in boarc.c
  128. //}
  129. /******************************************************************************/
  130. /* STM32F4xx Peripherals Interrupt Handlers */
  131. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  132. /* available peripheral interrupt handler's name please refer to the startup */
  133. /* file (startup_stm32f4xx.s). */
  134. /******************************************************************************/
  135. /**
  136. * @brief This function handles PPP interrupt request.
  137. * @param None
  138. * @retval None
  139. */
  140. /*void PPP_IRQHandler(void)
  141. {
  142. }*/
  143. void USART2_IRQHandler(void)
  144. {
  145. #ifdef RT_USING_UART2
  146. extern struct rt_device uart2_device;
  147. extern void rt_hw_serial_isr(struct rt_device *device);
  148. /* enter interrupt */
  149. rt_interrupt_enter();
  150. rt_hw_serial_isr(&uart2_device);
  151. /* leave interrupt */
  152. rt_interrupt_leave();
  153. #endif
  154. }
  155. /**
  156. * @}
  157. */
  158. /**
  159. * @}
  160. */
  161. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/