stm32f4xx_it.c 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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. //definitio in gdb/libcpu/cortexm
  111. //}
  112. /**
  113. * @brief This function handles PendSVC exception.
  114. * @param None
  115. * @retval None
  116. */
  117. //void PendSV_Handler(void)
  118. //{
  119. // // definition in libcpu/arm/cortex-m4/context_*.S
  120. //}
  121. /**
  122. * @brief This function handles SysTick Handler.
  123. * @param None
  124. * @retval None
  125. */
  126. //void SysTick_Handler(void)
  127. //{
  128. // // definition in boarc.c
  129. //}
  130. /******************************************************************************/
  131. /* STM32F4xx Peripherals Interrupt Handlers */
  132. /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
  133. /* available peripheral interrupt handler's name please refer to the startup */
  134. /* file (startup_stm32f4xx.s). */
  135. /******************************************************************************/
  136. /**
  137. * @brief This function handles PPP interrupt request.
  138. * @param None
  139. * @retval None
  140. */
  141. /*void PPP_IRQHandler(void)
  142. {
  143. }*/
  144. void USART1_IRQHandler(void)
  145. {
  146. #ifdef RT_USING_UART1
  147. extern struct rt_device uart1_device;
  148. extern void rt_hw_serial_isr(struct rt_device *device);
  149. /* enter interrupt */
  150. rt_interrupt_enter();
  151. rt_hw_serial_isr(&uart1_device);
  152. /* leave interrupt */
  153. rt_interrupt_leave();
  154. #endif
  155. }
  156. void USART2_IRQHandler(void)
  157. {
  158. #ifdef RT_USING_UART2
  159. extern struct rt_device uart2_device;
  160. extern void rt_hw_serial_isr(struct rt_device *device);
  161. /* enter interrupt */
  162. rt_interrupt_enter();
  163. rt_hw_serial_isr(&uart2_device);
  164. /* leave interrupt */
  165. rt_interrupt_leave();
  166. #endif
  167. }
  168. void USART3_IRQHandler(void)
  169. {
  170. #ifdef RT_USING_UART3
  171. extern struct rt_device uart3_device;
  172. extern void rt_hw_serial_isr(struct rt_device *device);
  173. /* enter interrupt */
  174. rt_interrupt_enter();
  175. rt_hw_serial_isr(&uart3_device);
  176. /* leave interrupt */
  177. rt_interrupt_leave();
  178. #endif
  179. }
  180. /**
  181. * @}
  182. */
  183. /**
  184. * @}
  185. */
  186. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/