Advertisement
Guest User

Untitled

a guest
Nov 9th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.12 KB | None | 0 0
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file stm32f1xx_it.c
  5. * @brief Interrupt Service Routines.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2019 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.  
  21. /* Includes ------------------------------------------------------------------*/
  22. #include "main.h"
  23. #include "stm32f1xx_it.h"
  24. /* Private includes ----------------------------------------------------------*/
  25. /* USER CODE BEGIN Includes */
  26. /* USER CODE END Includes */
  27.  
  28. /* Private typedef -----------------------------------------------------------*/
  29. /* USER CODE BEGIN TD */
  30.  
  31. /* USER CODE END TD */
  32.  
  33. /* Private define ------------------------------------------------------------*/
  34. /* USER CODE BEGIN PD */
  35.  
  36. /* USER CODE END PD */
  37.  
  38. /* Private macro -------------------------------------------------------------*/
  39. /* USER CODE BEGIN PM */
  40.  
  41. /* USER CODE END PM */
  42.  
  43. /* Private variables ---------------------------------------------------------*/
  44. /* USER CODE BEGIN PV */
  45.  
  46. /* USER CODE END PV */
  47.  
  48. /* Private function prototypes -----------------------------------------------*/
  49. /* USER CODE BEGIN PFP */
  50.  
  51. /* USER CODE END PFP */
  52.  
  53. /* Private user code ---------------------------------------------------------*/
  54. /* USER CODE BEGIN 0 */
  55.  
  56. /* USER CODE END 0 */
  57.  
  58. /* External variables --------------------------------------------------------*/
  59. extern UART_HandleTypeDef huart2;
  60. uint32_t opoznienie=0;
  61. /* USER CODE BEGIN EV */
  62.  
  63. /* USER CODE END EV */
  64.  
  65. /******************************************************************************/
  66. /* Cortex-M3 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.  
  75. /* USER CODE END NonMaskableInt_IRQn 0 */
  76. /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
  77.  
  78. /* USER CODE END NonMaskableInt_IRQn 1 */
  79. }
  80.  
  81. /**
  82. * @brief This function handles Hard fault interrupt.
  83. */
  84. void HardFault_Handler(void)
  85. {
  86. /* USER CODE BEGIN HardFault_IRQn 0 */
  87.  
  88. /* USER CODE END HardFault_IRQn 0 */
  89. while (1)
  90. {
  91. /* USER CODE BEGIN W1_HardFault_IRQn 0 */
  92. /* USER CODE END W1_HardFault_IRQn 0 */
  93. }
  94. }
  95.  
  96. /**
  97. * @brief This function handles Memory management fault.
  98. */
  99. void MemManage_Handler(void)
  100. {
  101. /* USER CODE BEGIN MemoryManagement_IRQn 0 */
  102.  
  103. /* USER CODE END MemoryManagement_IRQn 0 */
  104. while (1)
  105. {
  106. /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
  107. /* USER CODE END W1_MemoryManagement_IRQn 0 */
  108. }
  109. }
  110.  
  111. /**
  112. * @brief This function handles Prefetch fault, memory access fault.
  113. */
  114. void BusFault_Handler(void)
  115. {
  116. /* USER CODE BEGIN BusFault_IRQn 0 */
  117.  
  118. /* USER CODE END BusFault_IRQn 0 */
  119. while (1)
  120. {
  121. /* USER CODE BEGIN W1_BusFault_IRQn 0 */
  122. /* USER CODE END W1_BusFault_IRQn 0 */
  123. }
  124. }
  125.  
  126. /**
  127. * @brief This function handles Undefined instruction or illegal state.
  128. */
  129. void UsageFault_Handler(void)
  130. {
  131. /* USER CODE BEGIN UsageFault_IRQn 0 */
  132.  
  133. /* USER CODE END UsageFault_IRQn 0 */
  134. while (1)
  135. {
  136. /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
  137. /* USER CODE END W1_UsageFault_IRQn 0 */
  138. }
  139. }
  140.  
  141. /**
  142. * @brief This function handles System service call via SWI instruction.
  143. */
  144. void SVC_Handler(void)
  145. {
  146. /* USER CODE BEGIN SVCall_IRQn 0 */
  147.  
  148. /* USER CODE END SVCall_IRQn 0 */
  149. /* USER CODE BEGIN SVCall_IRQn 1 */
  150.  
  151. /* USER CODE END SVCall_IRQn 1 */
  152. }
  153.  
  154. /**
  155. * @brief This function handles Debug monitor.
  156. */
  157. void DebugMon_Handler(void)
  158. {
  159. /* USER CODE BEGIN DebugMonitor_IRQn 0 */
  160.  
  161. /* USER CODE END DebugMonitor_IRQn 0 */
  162. /* USER CODE BEGIN DebugMonitor_IRQn 1 */
  163.  
  164. /* USER CODE END DebugMonitor_IRQn 1 */
  165. }
  166.  
  167. /**
  168. * @brief This function handles Pendable request for system service.
  169. */
  170. void PendSV_Handler(void)
  171. {
  172. /* USER CODE BEGIN PendSV_IRQn 0 */
  173.  
  174. /* USER CODE END PendSV_IRQn 0 */
  175. /* USER CODE BEGIN PendSV_IRQn 1 */
  176.  
  177. /* USER CODE END PendSV_IRQn 1 */
  178. }
  179.  
  180. /**
  181. * @brief This function handles System tick timer.
  182. */
  183. void SysTick_Handler(void)
  184. {
  185. /* USER CODE BEGIN SysTick_IRQn 0 */
  186. opoznienie=opoznienie+1;
  187. /* USER CODE END SysTick_IRQn 0 */
  188. HAL_IncTick();
  189. /* USER CODE BEGIN SysTick_IRQn 1 */
  190.  
  191. /* USER CODE END SysTick_IRQn 1 */
  192. }
  193.  
  194. /******************************************************************************/
  195. /* STM32F1xx Peripheral Interrupt Handlers */
  196. /* Add here the Interrupt Handlers for the used peripherals. */
  197. /* For the available peripheral interrupt handler names, */
  198. /* please refer to the startup file (startup_stm32f1xx.s). */
  199. /******************************************************************************/
  200.  
  201. /**
  202. * @brief This function handles USART2 global interrupt.
  203. */
  204. void USART2_IRQHandler(void)
  205. {
  206. /* USER CODE BEGIN USART2_IRQn 0 */
  207.  
  208. /* USER CODE END USART2_IRQn 0 */
  209. HAL_UART_IRQHandler(&huart2);
  210. /* USER CODE BEGIN USART2_IRQn 1 */
  211.  
  212. /* USER CODE END USART2_IRQn 1 */
  213. }
  214.  
  215. /**
  216. * @brief This function handles EXTI line[15:10] interrupts.
  217. */
  218. void EXTI15_10_IRQHandler(void)
  219. {
  220. /* USER CODE BEGIN EXTI15_10_IRQn 0 */
  221.  
  222. /* USER CODE END EXTI15_10_IRQn 0 */
  223. HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
  224. /* USER CODE BEGIN EXTI15_10_IRQn 1 */
  225.  
  226. /* USER CODE END EXTI15_10_IRQn 1 */
  227. }
  228.  
  229. /* USER CODE BEGIN 1 */
  230.  
  231. /* USER CODE END 1 */
  232. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement