1 /* USER CODE BEGIN Header */
2 /**
3 ******************************************************************************
4 * @file stm32g0xx_it.c
5 * @brief Interrupt Service Routines.
6 ******************************************************************************
7 *
8 * COPYRIGHT(c) 2019 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
36 /* Includes ------------------------------------------------------------------*/
37 #include "main.h"
38 #include "stm32g0xx_it.h"
39 /* Private includes ----------------------------------------------------------*/
40 /* USER CODE BEGIN Includes */
41 /* USER CODE END Includes */
42
43 /* Private typedef -----------------------------------------------------------*/
44 /* USER CODE BEGIN TD */
45
46 /* USER CODE END TD */
47
48 /* Private define ------------------------------------------------------------*/
49 /* USER CODE BEGIN PD */
50
51 /* USER CODE END PD */
52
53 /* Private macro -------------------------------------------------------------*/
54 /* USER CODE BEGIN PM */
55
56 /* USER CODE END PM */
57
58 /* Private variables ---------------------------------------------------------*/
59 /* USER CODE BEGIN PV */
60
61 /* USER CODE END PV */
62
63 /* Private function prototypes -----------------------------------------------*/
64 /* USER CODE BEGIN PFP */
65
66 /* USER CODE END PFP */
67
68 /* Private user code ---------------------------------------------------------*/
69 /* USER CODE BEGIN 0 */
70
71 /* USER CODE END 0 */
72
73 /* External variables --------------------------------------------------------*/
74 extern UART_HandleTypeDef hlpuart1;
75 extern UART_HandleTypeDef huart3;
76 /* USER CODE BEGIN EV */
77
78 /* USER CODE END EV */
79
80 /******************************************************************************/
81 /* Cortex Processor Interruption and Exception Handlers */
82 /******************************************************************************/
83 /**
84 * @brief This function handles Non maskable interrupt.
85 */
NMI_Handler(void)86 void NMI_Handler(void)
87 {
88 /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
89
90 /* USER CODE END NonMaskableInt_IRQn 0 */
91 /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
92
93 /* USER CODE END NonMaskableInt_IRQn 1 */
94 }
95
96 /**
97 * @brief This function handles Hard fault interrupt.
98 */
HardFault_Handler(void)99 void HardFault_Handler(void)
100 {
101 /* USER CODE BEGIN HardFault_IRQn 0 */
102
103 /* USER CODE END HardFault_IRQn 0 */
104 while (1)
105 {
106 /* USER CODE BEGIN W1_HardFault_IRQn 0 */
107 /* USER CODE END W1_HardFault_IRQn 0 */
108 }
109 }
110
111 /**
112 * @brief This function handles System service call via SWI instruction.
113 */
SVC_Handler(void)114 void SVC_Handler(void)
115 {
116 /* USER CODE BEGIN SVC_IRQn 0 */
117
118 /* USER CODE END SVC_IRQn 0 */
119 /* USER CODE BEGIN SVC_IRQn 1 */
120
121 /* USER CODE END SVC_IRQn 1 */
122 }
123
124 /**
125 * @brief This function handles Pendable request for system service.
126 */
PendSV_Handler(void)127 void PendSV_Handler(void)
128 {
129 /* USER CODE BEGIN PendSV_IRQn 0 */
130
131 /* USER CODE END PendSV_IRQn 0 */
132 /* USER CODE BEGIN PendSV_IRQn 1 */
133
134 /* USER CODE END PendSV_IRQn 1 */
135 }
136
137 /**
138 * @brief This function handles System tick timer.
139 */
SysTick_Handler(void)140 void SysTick_Handler(void)
141 {
142 /* USER CODE BEGIN SysTick_IRQn 0 */
143
144 /* USER CODE END SysTick_IRQn 0 */
145 HAL_IncTick();
146 /* USER CODE BEGIN SysTick_IRQn 1 */
147
148 /* USER CODE END SysTick_IRQn 1 */
149 }
150
151 /******************************************************************************/
152 /* STM32G0xx Peripheral Interrupt Handlers */
153 /* Add here the Interrupt Handlers for the used peripherals. */
154 /* For the available peripheral interrupt handler names, */
155 /* please refer to the startup file (startup_stm32g0xx.s). */
156 /******************************************************************************/
157
158 /**
159 * @brief This function handles USART3, USART4 and LPUART1 interrupts / LPUART1 wake-up interrupt through EXTI line 28.
160 */
USART3_4_LPUART1_IRQHandler(void)161 void USART3_4_LPUART1_IRQHandler(void)
162 {
163 /* USER CODE BEGIN USART3_4_LPUART1_IRQn 0 */
164
165 /* USER CODE END USART3_4_LPUART1_IRQn 0 */
166 HAL_UART_IRQHandler(&huart3);
167 HAL_UART_IRQHandler(&hlpuart1);
168 /* USER CODE BEGIN USART3_4_LPUART1_IRQn 1 */
169
170 /* USER CODE END USART3_4_LPUART1_IRQn 1 */
171 }
172
173 /* USER CODE BEGIN 1 */
174
175 /* USER CODE END 1 */
176 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
177