stm32f4xx_it.c 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file stm32f4xx_it.c
  5. * @brief Interrupt Service Routines.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under Ultimate Liberty license
  13. * SLA0044, the "License"; You may not use this file except in compliance with
  14. * the License. You may obtain a copy of the License at:
  15. * www.st.com/SLA0044
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Includes ------------------------------------------------------------------*/
  21. #include "main.h"
  22. #include "stm32f4xx_it.h"
  23. /* Private includes ----------------------------------------------------------*/
  24. /* USER CODE BEGIN Includes */
  25. /* USER CODE END Includes */
  26. /* Private typedef -----------------------------------------------------------*/
  27. /* USER CODE BEGIN TD */
  28. /* USER CODE END TD */
  29. /* Private define ------------------------------------------------------------*/
  30. /* USER CODE BEGIN PD */
  31. /* USER CODE END PD */
  32. /* Private macro -------------------------------------------------------------*/
  33. /* USER CODE BEGIN PM */
  34. /* USER CODE END PM */
  35. /* Private variables ---------------------------------------------------------*/
  36. /* USER CODE BEGIN PV */
  37. /* USER CODE END PV */
  38. /* Private function prototypes -----------------------------------------------*/
  39. /* USER CODE BEGIN PFP */
  40. /* USER CODE END PFP */
  41. /* Private user code ---------------------------------------------------------*/
  42. /* USER CODE BEGIN 0 */
  43. /* USER CODE END 0 */
  44. /* External variables --------------------------------------------------------*/
  45. extern UART_HandleTypeDef huart4;
  46. extern UART_HandleTypeDef huart1;
  47. extern UART_HandleTypeDef huart2;
  48. /* USER CODE BEGIN EV */
  49. /* USER CODE END EV */
  50. /******************************************************************************/
  51. /* Cortex-M4 Processor Interruption and Exception Handlers */
  52. /******************************************************************************/
  53. /**
  54. * @brief This function handles Non maskable interrupt.
  55. */
  56. void NMI_Handler(void)
  57. {
  58. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  59. /* USER CODE END NonMaskableInt_IRQn 0 */
  60. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  61. /* USER CODE END NonMaskableInt_IRQn 1 */
  62. }
  63. /**
  64. * @brief This function handles Hard fault interrupt.
  65. */
  66. void HardFault_Handler(void)
  67. {
  68. /* USER CODE BEGIN HardFault_IRQn 0 */
  69. /* USER CODE END HardFault_IRQn 0 */
  70. while (1)
  71. {
  72. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  73. /* USER CODE END W1_HardFault_IRQn 0 */
  74. }
  75. }
  76. /**
  77. * @brief This function handles Memory management fault.
  78. */
  79. void MemManage_Handler(void)
  80. {
  81. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  82. /* USER CODE END MemoryManagement_IRQn 0 */
  83. while (1)
  84. {
  85. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  86. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  87. }
  88. }
  89. /**
  90. * @brief This function handles Pre-fetch fault, memory access fault.
  91. */
  92. void BusFault_Handler(void)
  93. {
  94. /* USER CODE BEGIN BusFault_IRQn 0 */
  95. /* USER CODE END BusFault_IRQn 0 */
  96. while (1)
  97. {
  98. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  99. /* USER CODE END W1_BusFault_IRQn 0 */
  100. }
  101. }
  102. /**
  103. * @brief This function handles Undefined instruction or illegal state.
  104. */
  105. void UsageFault_Handler(void)
  106. {
  107. /* USER CODE BEGIN UsageFault_IRQn 0 */
  108. /* USER CODE END UsageFault_IRQn 0 */
  109. while (1)
  110. {
  111. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  112. /* USER CODE END W1_UsageFault_IRQn 0 */
  113. }
  114. }
  115. /**
  116. * @brief This function handles System service call via SWI instruction.
  117. */
  118. void SVC_Handler(void)
  119. {
  120. /* USER CODE BEGIN SVCall_IRQn 0 */
  121. /* USER CODE END SVCall_IRQn 0 */
  122. /* USER CODE BEGIN SVCall_IRQn 1 */
  123. /* USER CODE END SVCall_IRQn 1 */
  124. }
  125. /**
  126. * @brief This function handles Debug monitor.
  127. */
  128. void DebugMon_Handler(void)
  129. {
  130. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  131. /* USER CODE END DebugMonitor_IRQn 0 */
  132. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  133. /* USER CODE END DebugMonitor_IRQn 1 */
  134. }
  135. /**
  136. * @brief This function handles Pendable request for system service.
  137. */
  138. void PendSV_Handler(void)
  139. {
  140. /* USER CODE BEGIN PendSV_IRQn 0 */
  141. /* USER CODE END PendSV_IRQn 0 */
  142. /* USER CODE BEGIN PendSV_IRQn 1 */
  143. /* USER CODE END PendSV_IRQn 1 */
  144. }
  145. /**
  146. * @brief This function handles System tick timer.
  147. */
  148. void SysTick_Handler(void)
  149. {
  150. /* USER CODE BEGIN SysTick_IRQn 0 */
  151. /* USER CODE END SysTick_IRQn 0 */
  152. HAL_IncTick();
  153. /* USER CODE BEGIN SysTick_IRQn 1 */
  154. /* USER CODE END SysTick_IRQn 1 */
  155. }
  156. /******************************************************************************/
  157. /* STM32F4xx Peripheral Interrupt Handlers */
  158. /* Add here the Interrupt Handlers for the used peripherals. */
  159. /* For the available peripheral interrupt handler names, */
  160. /* please refer to the startup file (startup_stm32f4xx.s). */
  161. /******************************************************************************/
  162. /**
  163. * @brief This function handles USART1 global interrupt.
  164. */
  165. void USART1_IRQHandler(void)
  166. {
  167. /* USER CODE BEGIN USART1_IRQn 0 */
  168. /* USER CODE END USART1_IRQn 0 */
  169. HAL_UART_IRQHandler(&huart1);
  170. /* USER CODE BEGIN USART1_IRQn 1 */
  171. /* USER CODE END USART1_IRQn 1 */
  172. }
  173. /**
  174. * @brief This function handles USART2 global interrupt.
  175. */
  176. void USART2_IRQHandler(void)
  177. {
  178. /* USER CODE BEGIN USART2_IRQn 0 */
  179. /* USER CODE END USART2_IRQn 0 */
  180. HAL_UART_IRQHandler(&huart2);
  181. /* USER CODE BEGIN USART2_IRQn 1 */
  182. /* USER CODE END USART2_IRQn 1 */
  183. }
  184. /**
  185. * @brief This function handles UART4 global interrupt.
  186. */
  187. void UART4_IRQHandler(void)
  188. {
  189. /* USER CODE BEGIN UART4_IRQn 0 */
  190. /* USER CODE END UART4_IRQn 0 */
  191. HAL_UART_IRQHandler(&huart4);
  192. /* USER CODE BEGIN UART4_IRQn 1 */
  193. /* USER CODE END UART4_IRQn 1 */
  194. }
  195. /* USER CODE BEGIN 1 */
  196. /* USER CODE END 1 */
  197. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/