stm32f4xx_it.c 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. /* Private includes ----------------------------------------------------------*/
  39. /* USER CODE BEGIN Includes */
  40. #include "Comunication.h"
  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 UART_HandleTypeDef huart6;
  62. extern TIM_HandleTypeDef htim5;
  63. /* USER CODE BEGIN EV */
  64. /* USER CODE END EV */
  65. /******************************************************************************/
  66. /* Cortex-M4 Processor Interruption and Exception Handlers */
  67. /******************************************************************************/
  68. /**
  69. * @brief This function handles Non maskable interrupt.
  70. */
  71. void NMI_Handler(void)
  72. {
  73. /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
  74. /* USER CODE END NonMaskableInt_IRQn 0 */
  75. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  76. /* USER CODE END NonMaskableInt_IRQn 1 */
  77. }
  78. /**
  79. * @brief This function handles Hard fault interrupt.
  80. */
  81. void HardFault_Handler(void)
  82. {
  83. /* USER CODE BEGIN HardFault_IRQn 0 */
  84. /* USER CODE END HardFault_IRQn 0 */
  85. while (1)
  86. {
  87. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  88. /* USER CODE END W1_HardFault_IRQn 0 */
  89. }
  90. }
  91. /**
  92. * @brief This function handles Memory management fault.
  93. */
  94. void MemManage_Handler(void)
  95. {
  96. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  97. /* USER CODE END MemoryManagement_IRQn 0 */
  98. while (1)
  99. {
  100. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  101. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  102. }
  103. }
  104. /**
  105. * @brief This function handles Pre-fetch fault, memory access fault.
  106. */
  107. void BusFault_Handler(void)
  108. {
  109. /* USER CODE BEGIN BusFault_IRQn 0 */
  110. /* USER CODE END BusFault_IRQn 0 */
  111. while (1)
  112. {
  113. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  114. /* USER CODE END W1_BusFault_IRQn 0 */
  115. }
  116. }
  117. /**
  118. * @brief This function handles Undefined instruction or illegal state.
  119. */
  120. void UsageFault_Handler(void)
  121. {
  122. /* USER CODE BEGIN UsageFault_IRQn 0 */
  123. /* USER CODE END UsageFault_IRQn 0 */
  124. while (1)
  125. {
  126. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  127. /* USER CODE END W1_UsageFault_IRQn 0 */
  128. }
  129. }
  130. /**
  131. * @brief This function handles Debug monitor.
  132. */
  133. void DebugMon_Handler(void)
  134. {
  135. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  136. /* USER CODE END DebugMonitor_IRQn 0 */
  137. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  138. /* USER CODE END DebugMonitor_IRQn 1 */
  139. }
  140. /******************************************************************************/
  141. /* STM32F4xx Peripheral Interrupt Handlers */
  142. /* Add here the Interrupt Handlers for the used peripherals. */
  143. /* For the available peripheral interrupt handler names, */
  144. /* please refer to the startup file (startup_stm32f4xx.s). */
  145. /******************************************************************************/
  146. /**
  147. * @brief This function handles TIM5 global interrupt.
  148. */
  149. void TIM5_IRQHandler(void)
  150. {
  151. /* USER CODE BEGIN TIM5_IRQn 0 */
  152. /* USER CODE END TIM5_IRQn 0 */
  153. HAL_TIM_IRQHandler(&htim5);
  154. /* USER CODE BEGIN TIM5_IRQn 1 */
  155. /* USER CODE END TIM5_IRQn 1 */
  156. }
  157. /**
  158. * @brief This function handles USART6 global interrupt.
  159. */
  160. void USART6_IRQHandler(void)
  161. {
  162. /* USER CODE BEGIN USART6_IRQn 0 */
  163. /* USER CODE END USART6_IRQn 0 */
  164. HAL_UART_IRQHandler(&huart6);
  165. /* USER CODE BEGIN USART6_IRQn 1 */
  166. /* USER CODE END USART6_IRQn 1 */
  167. }
  168. /* USER CODE BEGIN 1 */
  169. /* USER CODE END 1 */
  170. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/