Rev 18 | Rev 29 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18 | Rev 28 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | /* USER CODE BEGIN Header */ |
|
1 | /** |
2 | /** |
2 | ****************************************************************************** |
3 | ****************************************************************************** |
3 | * @file stm32l1xx_it.c |
4 | * @file stm32l1xx_it.c |
4 | * @brief Interrupt Service Routines. |
5 | * @brief Interrupt Service Routines. |
5 | ****************************************************************************** |
6 | ****************************************************************************** |
- | 7 | * @attention |
|
6 | * |
8 | * |
7 | * COPYRIGHT(c) 2017 STMicroelectronics |
9 | * <h2><center>© Copyright (c) 2020 STMicroelectronics. |
- | 10 | * All rights reserved.</center></h2> |
|
8 | * |
11 | * |
9 | * Redistribution and use in source and binary forms, with or without modification, |
12 | * This software component is licensed by ST under BSD 3-Clause license, |
10 | * are permitted provided that the following conditions are met: |
13 | * the "License"; You may not use this file except in compliance with the |
11 | * 1. Redistributions of source code must retain the above copyright notice, |
- | |
12 | * this list of conditions and the following disclaimer. |
- | |
13 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
- | |
14 | * this list of conditions and the following disclaimer in the documentation |
- | |
15 | * and/or other materials provided with the distribution. |
14 | * License. You may obtain a copy of the License at: |
16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
- | |
17 | * may be used to endorse or promote products derived from this software |
15 | * opensource.org/licenses/BSD-3-Clause |
18 | * without specific prior written permission. |
- | |
19 | * |
- | |
20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
- | |
21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
- | |
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
- | |
23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
- | |
24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
- | |
25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
- | |
26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
- | |
27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
- | |
28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
- | |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- | |
30 | * |
16 | * |
31 | ****************************************************************************** |
17 | ****************************************************************************** |
32 | */ |
18 | */ |
- | 19 | /* USER CODE END Header */ |
|
- | 20 | ||
33 | /* Includes ------------------------------------------------------------------*/ |
21 | /* Includes ------------------------------------------------------------------*/ |
34 | #include "stm32l1xx_hal.h" |
- | |
35 | #include "stm32l1xx.h" |
22 | #include "main.h" |
36 | #include "stm32l1xx_it.h" |
23 | #include "stm32l1xx_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 */ |
|
37 | 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 ---------------------------------------------------------*/ |
|
38 | /* USER CODE BEGIN 0 */ |
54 | /* USER CODE BEGIN 0 */ |
39 | 55 | ||
40 | /* USER CODE END 0 */ |
56 | /* USER CODE END 0 */ |
41 | 57 | ||
42 | /* External variables --------------------------------------------------------*/ |
58 | /* External variables --------------------------------------------------------*/ |
43 | extern DMA_HandleTypeDef hdma_adc; |
59 | extern DMA_HandleTypeDef hdma_adc; |
- | 60 | /* USER CODE BEGIN EV */ |
|
- | 61 | ||
- | 62 | /* USER CODE END EV */ |
|
44 | 63 | ||
45 | /******************************************************************************/ |
64 | /******************************************************************************/ |
46 | /* Cortex-M3 Processor Interruption and Exception Handlers */ |
65 | /* Cortex-M3 Processor Interruption and Exception Handlers */ |
47 | /******************************************************************************/ |
66 | /******************************************************************************/ |
48 | - | ||
49 | /** |
67 | /** |
50 | * @brief This function handles Non maskable interrupt. |
68 | * @brief This function handles Non maskable interrupt. |
51 | */ |
69 | */ |
52 | void NMI_Handler(void) |
70 | void NMI_Handler(void) |
53 | { |
71 | { |
54 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ |
72 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ |
55 | 73 | ||
56 | /* USER CODE END NonMaskableInt_IRQn 0 */ |
74 | /* USER CODE END NonMaskableInt_IRQn 0 */ |
Line 58... | Line 76... | ||
58 | 76 | ||
59 | /* USER CODE END NonMaskableInt_IRQn 1 */ |
77 | /* USER CODE END NonMaskableInt_IRQn 1 */ |
60 | } |
78 | } |
61 | 79 | ||
62 | /** |
80 | /** |
63 | * @brief This function handles Hard fault interrupt. |
81 | * @brief This function handles Hard fault interrupt. |
64 | */ |
82 | */ |
65 | void HardFault_Handler(void) |
83 | void HardFault_Handler(void) |
66 | { |
84 | { |
67 | /* USER CODE BEGIN HardFault_IRQn 0 */ |
85 | /* USER CODE BEGIN HardFault_IRQn 0 */ |
68 | 86 | ||
69 | /* USER CODE END HardFault_IRQn 0 */ |
87 | /* USER CODE END HardFault_IRQn 0 */ |
70 | while (1) |
88 | while (1) |
71 | { |
89 | { |
- | 90 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */ |
|
- | 91 | /* USER CODE END W1_HardFault_IRQn 0 */ |
|
72 | } |
92 | } |
73 | /* USER CODE BEGIN HardFault_IRQn 1 */ |
- | |
74 | - | ||
75 | /* USER CODE END HardFault_IRQn 1 */ |
- | |
76 | } |
93 | } |
77 | 94 | ||
78 | /** |
95 | /** |
79 | * @brief This function handles Memory management fault. |
96 | * @brief This function handles Memory management fault. |
80 | */ |
97 | */ |
81 | void MemManage_Handler(void) |
98 | void MemManage_Handler(void) |
82 | { |
99 | { |
83 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ |
100 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */ |
84 | 101 | ||
85 | /* USER CODE END MemoryManagement_IRQn 0 */ |
102 | /* USER CODE END MemoryManagement_IRQn 0 */ |
86 | while (1) |
103 | while (1) |
87 | { |
104 | { |
- | 105 | /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ |
|
- | 106 | /* USER CODE END W1_MemoryManagement_IRQn 0 */ |
|
88 | } |
107 | } |
89 | /* USER CODE BEGIN MemoryManagement_IRQn 1 */ |
- | |
90 | - | ||
91 | /* USER CODE END MemoryManagement_IRQn 1 */ |
- | |
92 | } |
108 | } |
93 | 109 | ||
94 | /** |
110 | /** |
95 | * @brief This function handles Pre-fetch fault, memory access fault. |
111 | * @brief This function handles Pre-fetch fault, memory access fault. |
96 | */ |
112 | */ |
97 | void BusFault_Handler(void) |
113 | void BusFault_Handler(void) |
98 | { |
114 | { |
99 | /* USER CODE BEGIN BusFault_IRQn 0 */ |
115 | /* USER CODE BEGIN BusFault_IRQn 0 */ |
100 | 116 | ||
101 | /* USER CODE END BusFault_IRQn 0 */ |
117 | /* USER CODE END BusFault_IRQn 0 */ |
102 | while (1) |
118 | while (1) |
103 | { |
119 | { |
- | 120 | /* USER CODE BEGIN W1_BusFault_IRQn 0 */ |
|
- | 121 | /* USER CODE END W1_BusFault_IRQn 0 */ |
|
104 | } |
122 | } |
105 | /* USER CODE BEGIN BusFault_IRQn 1 */ |
- | |
106 | - | ||
107 | /* USER CODE END BusFault_IRQn 1 */ |
- | |
108 | } |
123 | } |
109 | 124 | ||
110 | /** |
125 | /** |
111 | * @brief This function handles Undefined instruction or illegal state. |
126 | * @brief This function handles Undefined instruction or illegal state. |
112 | */ |
127 | */ |
113 | void UsageFault_Handler(void) |
128 | void UsageFault_Handler(void) |
114 | { |
129 | { |
115 | /* USER CODE BEGIN UsageFault_IRQn 0 */ |
130 | /* USER CODE BEGIN UsageFault_IRQn 0 */ |
116 | 131 | ||
117 | /* USER CODE END UsageFault_IRQn 0 */ |
132 | /* USER CODE END UsageFault_IRQn 0 */ |
118 | while (1) |
133 | while (1) |
119 | { |
134 | { |
- | 135 | /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ |
|
- | 136 | /* USER CODE END W1_UsageFault_IRQn 0 */ |
|
120 | } |
137 | } |
121 | /* USER CODE BEGIN UsageFault_IRQn 1 */ |
- | |
122 | - | ||
123 | /* USER CODE END UsageFault_IRQn 1 */ |
- | |
124 | } |
138 | } |
125 | 139 | ||
126 | /** |
140 | /** |
127 | * @brief This function handles System service call via SWI instruction. |
141 | * @brief This function handles System service call via SWI instruction. |
128 | */ |
142 | */ |
129 | void SVC_Handler(void) |
143 | void SVC_Handler(void) |
130 | { |
144 | { |
131 | /* USER CODE BEGIN SVC_IRQn 0 */ |
145 | /* USER CODE BEGIN SVC_IRQn 0 */ |
132 | 146 | ||
133 | /* USER CODE END SVC_IRQn 0 */ |
147 | /* USER CODE END SVC_IRQn 0 */ |
Line 135... | Line 149... | ||
135 | 149 | ||
136 | /* USER CODE END SVC_IRQn 1 */ |
150 | /* USER CODE END SVC_IRQn 1 */ |
137 | } |
151 | } |
138 | 152 | ||
139 | /** |
153 | /** |
140 | * @brief This function handles Debug monitor. |
154 | * @brief This function handles Debug monitor. |
141 | */ |
155 | */ |
142 | void DebugMon_Handler(void) |
156 | void DebugMon_Handler(void) |
143 | { |
157 | { |
144 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ |
158 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */ |
145 | 159 | ||
146 | /* USER CODE END DebugMonitor_IRQn 0 */ |
160 | /* USER CODE END DebugMonitor_IRQn 0 */ |
Line 148... | Line 162... | ||
148 | 162 | ||
149 | /* USER CODE END DebugMonitor_IRQn 1 */ |
163 | /* USER CODE END DebugMonitor_IRQn 1 */ |
150 | } |
164 | } |
151 | 165 | ||
152 | /** |
166 | /** |
153 | * @brief This function handles Pendable request for system service. |
167 | * @brief This function handles Pendable request for system service. |
154 | */ |
168 | */ |
155 | void PendSV_Handler(void) |
169 | void PendSV_Handler(void) |
156 | { |
170 | { |
157 | /* USER CODE BEGIN PendSV_IRQn 0 */ |
171 | /* USER CODE BEGIN PendSV_IRQn 0 */ |
158 | 172 | ||
159 | /* USER CODE END PendSV_IRQn 0 */ |
173 | /* USER CODE END PendSV_IRQn 0 */ |
Line 161... | Line 175... | ||
161 | 175 | ||
162 | /* USER CODE END PendSV_IRQn 1 */ |
176 | /* USER CODE END PendSV_IRQn 1 */ |
163 | } |
177 | } |
164 | 178 | ||
165 | /** |
179 | /** |
166 | * @brief This function handles System tick timer. |
180 | * @brief This function handles System tick timer. |
167 | */ |
181 | */ |
168 | void SysTick_Handler(void) |
182 | void SysTick_Handler(void) |
169 | { |
183 | { |
170 | /* USER CODE BEGIN SysTick_IRQn 0 */ |
184 | /* USER CODE BEGIN SysTick_IRQn 0 */ |
171 | 185 | ||
172 | /* USER CODE END SysTick_IRQn 0 */ |
186 | /* USER CODE END SysTick_IRQn 0 */ |
173 | HAL_IncTick(); |
187 | HAL_IncTick(); |
174 | HAL_SYSTICK_IRQHandler(); |
- | |
175 | /* USER CODE BEGIN SysTick_IRQn 1 */ |
188 | /* USER CODE BEGIN SysTick_IRQn 1 */ |
176 | 189 | ||
177 | /* USER CODE END SysTick_IRQn 1 */ |
190 | /* USER CODE END SysTick_IRQn 1 */ |
178 | } |
191 | } |
179 | 192 | ||
Line 183... | Line 196... | ||
183 | /* For the available peripheral interrupt handler names, */ |
196 | /* For the available peripheral interrupt handler names, */ |
184 | /* please refer to the startup file (startup_stm32l1xx.s). */ |
197 | /* please refer to the startup file (startup_stm32l1xx.s). */ |
185 | /******************************************************************************/ |
198 | /******************************************************************************/ |
186 | 199 | ||
187 | /** |
200 | /** |
188 | * @brief This function handles DMA1 channel1 global interrupt. |
201 | * @brief This function handles DMA1 channel1 global interrupt. |
189 | */ |
202 | */ |
190 | void DMA1_Channel1_IRQHandler(void) |
203 | void DMA1_Channel1_IRQHandler(void) |
191 | { |
204 | { |
192 | /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */ |
205 | /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */ |
193 | 206 | ||
194 | /* USER CODE END DMA1_Channel1_IRQn 0 */ |
207 | /* USER CODE END DMA1_Channel1_IRQn 0 */ |