stm32f4xx_it.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file stm32f4xx_it.c
  5. * @brief Interrupt Service Routines.
  6. ******************************************************************************
  7. *
  8. * COPYRIGHT(c) 2018 STMicroelectronics
  9. *
  10. * Redistribution and use in source and binary forms, with or without modification,
  11. * are permitted provided that the following conditions are met:
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright notice,
  15. * this list of conditions and the following disclaimer in the documentation
  16. * and/or other materials provided with the distribution.
  17. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  18. * may be used to endorse or promote products derived from this software
  19. * without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  22. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  24. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  25. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  27. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  28. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  29. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. ******************************************************************************
  33. */
  34. /* USER CODE END Header */
  35. /* Includes ------------------------------------------------------------------*/
  36. #include "main.h"
  37. #include "stm32f4xx_it.h"
  38. #include "cmsis_os.h"
  39. /* Private includes ----------------------------------------------------------*/
  40. /* USER CODE BEGIN Includes */
  41. /* USER CODE END Includes */
  42. /* Private typedef -----------------------------------------------------------*/
  43. /* USER CODE BEGIN TD */
  44. /* USER CODE END TD */
  45. /* Private define ------------------------------------------------------------*/
  46. /* USER CODE BEGIN PD */
  47. /* USER CODE END PD */
  48. /* Private macro -------------------------------------------------------------*/
  49. /* USER CODE BEGIN PM */
  50. /* USER CODE END PM */
  51. /* Private variables ---------------------------------------------------------*/
  52. /* USER CODE BEGIN PV */
  53. /* USER CODE END PV */
  54. /* Private function prototypes -----------------------------------------------*/
  55. /* USER CODE BEGIN PFP */
  56. /* USER CODE END PFP */
  57. /* Private user code ---------------------------------------------------------*/
  58. /* USER CODE BEGIN 0 */
  59. /* USER CODE END 0 */
  60. /* External variables --------------------------------------------------------*/
  61. extern TIM_HandleTypeDef htim5;
  62. /* USER CODE BEGIN EV */
  63. /* USER CODE END EV */
  64. /******************************************************************************/
  65. /* Cortex-M4 Processor Interruption and Exception Handlers */
  66. /******************************************************************************/
  67. /**
  68. * @brief This function handles Non maskable interrupt.
  69. */
  70. void NMI_Handler(void) {
  71. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  72. /* USER CODE END NonMaskableInt_IRQn 0 */
  73. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  74. /* USER CODE END NonMaskableInt_IRQn 1 */
  75. }
  76. /**
  77. * @brief This function handles Hard fault interrupt.
  78. */
  79. void HardFault_Handler(void) {
  80. /* USER CODE BEGIN HardFault_IRQn 0 */
  81. /* USER CODE END HardFault_IRQn 0 */
  82. while (1) {
  83. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  84. /* USER CODE END W1_HardFault_IRQn 0 */
  85. }
  86. }
  87. /**
  88. * @brief This function handles Memory management fault.
  89. */
  90. void MemManage_Handler(void) {
  91. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  92. /* USER CODE END MemoryManagement_IRQn 0 */
  93. while (1) {
  94. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  95. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  96. }
  97. }
  98. /**
  99. * @brief This function handles Pre-fetch fault, memory access fault.
  100. */
  101. void BusFault_Handler(void) {
  102. /* USER CODE BEGIN BusFault_IRQn 0 */
  103. /* USER CODE END BusFault_IRQn 0 */
  104. while (1) {
  105. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  106. /* USER CODE END W1_BusFault_IRQn 0 */
  107. }
  108. }
  109. /**
  110. * @brief This function handles Undefined instruction or illegal state.
  111. */
  112. void UsageFault_Handler(void) {
  113. /* USER CODE BEGIN UsageFault_IRQn 0 */
  114. /* USER CODE END UsageFault_IRQn 0 */
  115. while (1) {
  116. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  117. /* USER CODE END W1_UsageFault_IRQn 0 */
  118. }
  119. }
  120. /**
  121. * @brief This function handles Debug monitor.
  122. */
  123. void DebugMon_Handler(void) {
  124. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  125. /* USER CODE END DebugMonitor_IRQn 0 */
  126. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  127. /* USER CODE END DebugMonitor_IRQn 1 */
  128. }
  129. /******************************************************************************/
  130. /* STM32F4xx Peripheral Interrupt Handlers */
  131. /* Add here the Interrupt Handlers for the used peripherals. */
  132. /* For the available peripheral interrupt handler names, */
  133. /* please refer to the startup file (startup_stm32f4xx.s). */
  134. /******************************************************************************/
  135. /**
  136. * @brief This function handles TIM5 global interrupt.
  137. */
  138. void TIM5_IRQHandler(void) {
  139. /* USER CODE BEGIN TIM5_IRQn 0 */
  140. /* USER CODE END TIM5_IRQn 0 */
  141. HAL_TIM_IRQHandler(&htim5);
  142. /* USER CODE BEGIN TIM5_IRQn 1 */
  143. /* USER CODE END TIM5_IRQn 1 */
  144. }
  145. /* USER CODE BEGIN 1 */
  146. /* USER CODE END 1 */
  147. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/