stm32f4xx_it.c 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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) 2021 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. /* 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 PCD_HandleTypeDef hpcd_USB_OTG_FS;
  46. extern ADC_HandleTypeDef hadc1;
  47. extern ADC_HandleTypeDef hadc2;
  48. extern TIM_HandleTypeDef htim3;
  49. /* USER CODE BEGIN EV */
  50. /* USER CODE END EV */
  51. /******************************************************************************/
  52. /* Cortex-M4 Processor Interruption and Exception Handlers */
  53. /******************************************************************************/
  54. /**
  55. * @brief This function handles Hard fault interrupt.
  56. */
  57. void HardFault_Handler(void)
  58. {
  59. /* USER CODE BEGIN HardFault_IRQn 0 */
  60. /* USER CODE END HardFault_IRQn 0 */
  61. while (1)
  62. {
  63. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  64. /* USER CODE END W1_HardFault_IRQn 0 */
  65. }
  66. }
  67. /**
  68. * @brief This function handles Memory management fault.
  69. */
  70. void MemManage_Handler(void)
  71. {
  72. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  73. /* USER CODE END MemoryManagement_IRQn 0 */
  74. while (1)
  75. {
  76. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  77. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  78. }
  79. }
  80. /**
  81. * @brief This function handles Pre-fetch fault, memory access fault.
  82. */
  83. void BusFault_Handler(void)
  84. {
  85. /* USER CODE BEGIN BusFault_IRQn 0 */
  86. /* USER CODE END BusFault_IRQn 0 */
  87. while (1)
  88. {
  89. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  90. /* USER CODE END W1_BusFault_IRQn 0 */
  91. }
  92. }
  93. /**
  94. * @brief This function handles Undefined instruction or illegal state.
  95. */
  96. void UsageFault_Handler(void)
  97. {
  98. /* USER CODE BEGIN UsageFault_IRQn 0 */
  99. /* USER CODE END UsageFault_IRQn 0 */
  100. while (1)
  101. {
  102. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  103. /* USER CODE END W1_UsageFault_IRQn 0 */
  104. }
  105. }
  106. /**
  107. * @brief This function handles System service call via SWI instruction.
  108. */
  109. void SVC_Handler(void)
  110. {
  111. /* USER CODE BEGIN SVCall_IRQn 0 */
  112. /* USER CODE END SVCall_IRQn 0 */
  113. /* USER CODE BEGIN SVCall_IRQn 1 */
  114. /* USER CODE END SVCall_IRQn 1 */
  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 Pendable request for system service.
  128. */
  129. void PendSV_Handler(void)
  130. {
  131. /* USER CODE BEGIN PendSV_IRQn 0 */
  132. /* USER CODE END PendSV_IRQn 0 */
  133. /* USER CODE BEGIN PendSV_IRQn 1 */
  134. /* USER CODE END PendSV_IRQn 1 */
  135. }
  136. /**
  137. * @brief This function handles System tick timer.
  138. */
  139. void SysTick_Handler(void)
  140. {
  141. /* USER CODE BEGIN SysTick_IRQn 0 */
  142. /* USER CODE END SysTick_IRQn 0 */
  143. HAL_IncTick();
  144. /* USER CODE BEGIN SysTick_IRQn 1 */
  145. /* USER CODE END SysTick_IRQn 1 */
  146. }
  147. /******************************************************************************/
  148. /* STM32F4xx Peripheral Interrupt Handlers */
  149. /* Add here the Interrupt Handlers for the used peripherals. */
  150. /* For the available peripheral interrupt handler names, */
  151. /* please refer to the startup file (startup_stm32f4xx.s). */
  152. /******************************************************************************/
  153. /**
  154. * @brief This function handles EXTI line 1 interrupt.
  155. */
  156. void EXTI1_IRQHandler(void)
  157. {
  158. /* USER CODE BEGIN EXTI1_IRQn 0 */
  159. /* USER CODE END EXTI1_IRQn 0 */
  160. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1);
  161. /* USER CODE BEGIN EXTI1_IRQn 1 */
  162. /* USER CODE END EXTI1_IRQn 1 */
  163. }
  164. /**
  165. * @brief This function handles ADC1, ADC2 and ADC3 interrupts.
  166. */
  167. void ADC_IRQHandler(void)
  168. {
  169. /* USER CODE BEGIN ADC_IRQn 0 */
  170. /* USER CODE END ADC_IRQn 0 */
  171. HAL_ADC_IRQHandler(&hadc1);
  172. HAL_ADC_IRQHandler(&hadc2);
  173. /* USER CODE BEGIN ADC_IRQn 1 */
  174. /* USER CODE END ADC_IRQn 1 */
  175. }
  176. /**
  177. * @brief This function handles EXTI line[9:5] interrupts.
  178. */
  179. void EXTI9_5_IRQHandler(void)
  180. {
  181. /* USER CODE BEGIN EXTI9_5_IRQn 0 */
  182. /* USER CODE END EXTI9_5_IRQn 0 */
  183. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_6);
  184. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_7);
  185. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8);
  186. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_9);
  187. /* USER CODE BEGIN EXTI9_5_IRQn 1 */
  188. /* USER CODE END EXTI9_5_IRQn 1 */
  189. }
  190. /**
  191. * @brief This function handles TIM3 global interrupt.
  192. */
  193. void TIM3_IRQHandler(void)
  194. {
  195. /* USER CODE BEGIN TIM3_IRQn 0 */
  196. /* USER CODE END TIM3_IRQn 0 */
  197. HAL_TIM_IRQHandler(&htim3);
  198. /* USER CODE BEGIN TIM3_IRQn 1 */
  199. /* USER CODE END TIM3_IRQn 1 */
  200. }
  201. /**
  202. * @brief This function handles USB On The Go FS global interrupt.
  203. */
  204. void OTG_FS_IRQHandler(void)
  205. {
  206. /* USER CODE BEGIN OTG_FS_IRQn 0 */
  207. /* USER CODE END OTG_FS_IRQn 0 */
  208. HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
  209. /* USER CODE BEGIN OTG_FS_IRQn 1 */
  210. /* USER CODE END OTG_FS_IRQn 1 */
  211. }
  212. /* USER CODE BEGIN 1 */
  213. /* USER CODE END 1 */
  214. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/