stm32f1xx_it.c 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file stm32f1xx_it.c
  5. * @brief Interrupt Service Routines.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2025 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* USER CODE END Header */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "main.h"
  21. #include "stm32f1xx_it.h"
  22. #include "FreeRTOS.h"
  23. #include "task.h"
  24. /* Private includes ----------------------------------------------------------*/
  25. /* USER CODE BEGIN Includes */
  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-M3 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 Prefetch 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 Debug monitor.
  118. */
  119. void DebugMon_Handler(void)
  120. {
  121. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  122. /* USER CODE END DebugMonitor_IRQn 0 */
  123. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  124. /* USER CODE END DebugMonitor_IRQn 1 */
  125. }
  126. /**
  127. * @brief This function handles System tick timer.
  128. */
  129. void SysTick_Handler(void)
  130. {
  131. /* USER CODE BEGIN SysTick_IRQn 0 */
  132. /* USER CODE END SysTick_IRQn 0 */
  133. HAL_IncTick();
  134. #if (INCLUDE_xTaskGetSchedulerState == 1 )
  135. if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
  136. {
  137. #endif /* INCLUDE_xTaskGetSchedulerState */
  138. xPortSysTickHandler();
  139. #if (INCLUDE_xTaskGetSchedulerState == 1 )
  140. }
  141. #endif /* INCLUDE_xTaskGetSchedulerState */
  142. /* USER CODE BEGIN SysTick_IRQn 1 */
  143. /* USER CODE END SysTick_IRQn 1 */
  144. }
  145. /******************************************************************************/
  146. /* STM32F1xx Peripheral Interrupt Handlers */
  147. /* Add here the Interrupt Handlers for the used peripherals. */
  148. /* For the available peripheral interrupt handler names, */
  149. /* please refer to the startup file (startup_stm32f1xx.s). */
  150. /******************************************************************************/
  151. /* USER CODE BEGIN 1 */
  152. /* USER CODE END 1 */