您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

217 行
5.4 KiB

  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) 2026 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  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. #include <ucos_ii.h>
  26. /* USER CODE END Includes */
  27. /* Private typedef -----------------------------------------------------------*/
  28. /* USER CODE BEGIN TD */
  29. /* USER CODE END TD */
  30. /* Private define ------------------------------------------------------------*/
  31. /* USER CODE BEGIN PD */
  32. /* USER CODE END PD */
  33. /* Private macro -------------------------------------------------------------*/
  34. /* USER CODE BEGIN PM */
  35. /* USER CODE END PM */
  36. /* Private variables ---------------------------------------------------------*/
  37. /* USER CODE BEGIN PV */
  38. /* USER CODE END PV */
  39. /* Private function prototypes -----------------------------------------------*/
  40. /* USER CODE BEGIN PFP */
  41. /* USER CODE END PFP */
  42. /* Private user code ---------------------------------------------------------*/
  43. /* USER CODE BEGIN 0 */
  44. /* USER CODE END 0 */
  45. /* External variables --------------------------------------------------------*/
  46. /* USER CODE BEGIN EV */
  47. /* USER CODE END EV */
  48. /******************************************************************************/
  49. /* Cortex-M4 Processor Interruption and Exception Handlers */
  50. /******************************************************************************/
  51. /**
  52. * @brief This function handles Non maskable interrupt.
  53. */
  54. void NMI_Handler(void)
  55. {
  56. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  57. /* USER CODE END NonMaskableInt_IRQn 0 */
  58. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  59. while (1)
  60. {
  61. }
  62. /* USER CODE END NonMaskableInt_IRQn 1 */
  63. }
  64. /**
  65. * @brief This function handles Hard fault interrupt.
  66. */
  67. void HardFault_Handler(void)
  68. {
  69. /* USER CODE BEGIN HardFault_IRQn 0 */
  70. /* USER CODE END HardFault_IRQn 0 */
  71. while (1)
  72. {
  73. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  74. /* USER CODE END W1_HardFault_IRQn 0 */
  75. }
  76. }
  77. /**
  78. * @brief This function handles Memory management fault.
  79. */
  80. void MemManage_Handler(void)
  81. {
  82. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  83. /* USER CODE END MemoryManagement_IRQn 0 */
  84. while (1)
  85. {
  86. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  87. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  88. }
  89. }
  90. /**
  91. * @brief This function handles Pre-fetch fault, memory access fault.
  92. */
  93. void BusFault_Handler(void)
  94. {
  95. /* USER CODE BEGIN BusFault_IRQn 0 */
  96. /* USER CODE END BusFault_IRQn 0 */
  97. while (1)
  98. {
  99. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  100. /* USER CODE END W1_BusFault_IRQn 0 */
  101. }
  102. }
  103. /**
  104. * @brief This function handles Undefined instruction or illegal state.
  105. */
  106. void UsageFault_Handler(void)
  107. {
  108. /* USER CODE BEGIN UsageFault_IRQn 0 */
  109. /* USER CODE END UsageFault_IRQn 0 */
  110. while (1)
  111. {
  112. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  113. /* USER CODE END W1_UsageFault_IRQn 0 */
  114. }
  115. }
  116. /**
  117. * @brief This function handles System service call via SWI instruction.
  118. */
  119. void SVC_Handler(void)
  120. {
  121. /* USER CODE BEGIN SVCall_IRQn 0 */
  122. /* USER CODE END SVCall_IRQn 0 */
  123. /* USER CODE BEGIN SVCall_IRQn 1 */
  124. /* USER CODE END SVCall_IRQn 1 */
  125. }
  126. /**
  127. * @brief This function handles Debug monitor.
  128. */
  129. void DebugMon_Handler(void)
  130. {
  131. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  132. /* USER CODE END DebugMonitor_IRQn 0 */
  133. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  134. /* USER CODE END DebugMonitor_IRQn 1 */
  135. }
  136. /**
  137. * @brief This function handles Pendable request for system service.
  138. */
  139. void PendSV_Handler(void)
  140. {
  141. /* USER CODE BEGIN PendSV_IRQn 0 */
  142. /* USER CODE END PendSV_IRQn 0 */
  143. /* USER CODE BEGIN PendSV_IRQn 1 */
  144. /* USER CODE END PendSV_IRQn 1 */
  145. }
  146. /**
  147. * @brief This function handles System tick timer.
  148. */
  149. void SysTick_Handler(void)
  150. {
  151. /* USER CODE BEGIN SysTick_IRQn 0 */
  152. /* USER CODE END SysTick_IRQn 0 */
  153. if (OSRunning == OS_TRUE) {
  154. OSIntEnter();
  155. OSTimeTick();
  156. OSIntExit();
  157. }
  158. HAL_IncTick();
  159. /* USER CODE BEGIN SysTick_IRQn 1 */
  160. /* USER CODE END SysTick_IRQn 1 */
  161. }
  162. /******************************************************************************/
  163. /* STM32F4xx Peripheral Interrupt Handlers */
  164. /* Add here the Interrupt Handlers for the used peripherals. */
  165. /* For the available peripheral interrupt handler names, */
  166. /* please refer to the startup file (startup_stm32f4xx.s). */
  167. /******************************************************************************/
  168. /* USER CODE BEGIN 1 */
  169. void USART1_IRQHandler(void)
  170. {
  171. HAL_UART_IRQHandler(&huart1);
  172. }
  173. /* USER CODE END 1 */
  174. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/