Mercurial > public > ostc4
annotate Small_CPU/Src/stm32f4xx_it_v3.c @ 988:d9290c76b840 GasConsumption
OSTC4/5 joined code:
In the previous version code differences between OSTC4/5 were identified using the ENABLE_GPIO_V2 compiler switch. In the new version this is done using the display version as indicator which OSTC model is in used. Since this is detected by Firmware the information is forwarded from there to the RTE. This causes a little delay in the GPIO initialization but this applies only to the cold start of the RTE which should not happen very often.
author | ideenmodellierer |
---|---|
date | Sun, 06 Apr 2025 21:02:17 +0200 (9 days ago) |
parents | 6fc0e3d230e4 |
children |
rev | line source |
---|---|
38 | 1 /** |
2 ****************************************************************************** | |
3 * @file GPIO/GPIO_IOToggle/Src/stm32f4xx_it.c | |
4 * @author MCD Application Team | |
5 * @version V1.1.0 | |
6 * @date 26-June-2014 | |
7 * @brief Main Interrupt Service Routines. | |
8 * This file provides template for all exceptions handler and | |
9 * peripherals interrupt service routine. | |
10 ****************************************************************************** | |
11 * @attention | |
12 * | |
13 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> | |
14 * | |
15 * Redistribution and use in source and binary forms, with or without modification, | |
16 * are permitted provided that the following conditions are met: | |
17 * 1. Redistributions of source code must retain the above copyright notice, | |
18 * this list of conditions and the following disclaimer. | |
19 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
20 * this list of conditions and the following disclaimer in the documentation | |
21 * and/or other materials provided with the distribution. | |
22 * 3. Neither the name of STMicroelectronics nor the names of its contributors | |
23 * may be used to endorse or promote products derived from this software | |
24 * without specific prior written permission. | |
25 * | |
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
33 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
36 * | |
37 ****************************************************************************** | |
38 */ | |
39 | |
40 /* Includes ------------------------------------------------------------------*/ | |
41 #include "baseCPU2.h" | |
42 #include "stm32f4xx_it_v3.h" | |
43 | |
44 /** @addtogroup STM32F4xx_HAL_Examples | |
45 * @{ | |
46 */ | |
47 | |
48 /** @addtogroup GPIO_IOToggle | |
49 * @{ | |
50 */ | |
51 | |
52 /* Private typedef -----------------------------------------------------------*/ | |
53 /* Private define ------------------------------------------------------------*/ | |
54 /* Private macro -------------------------------------------------------------*/ | |
55 /* Private variables ---------------------------------------------------------*/ | |
56 extern I2C_HandleTypeDef I2cHandle; | |
57 extern SPI_HandleTypeDef hspi1; | |
58 extern RTC_HandleTypeDef RTCHandle; | |
59 extern ADC_HandleTypeDef AdcHandle; | |
60 | |
662 | 61 extern UART_HandleTypeDef huart1; |
62 extern DMA_HandleTypeDef hdma_usart1_rx; | |
916
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
662
diff
changeset
|
63 extern DMA_HandleTypeDef hdma_usart1_tx; |
988 | 64 #ifdef ENABLE_GNSS_INTERN |
922 | 65 extern UART_HandleTypeDef huart6; |
66 extern DMA_HandleTypeDef hdma_usart6_rx; | |
67 extern DMA_HandleTypeDef hdma_usart6_tx; | |
988 | 68 #endif |
38 | 69 /* Private function prototypes -----------------------------------------------*/ |
70 /* Private functions ---------------------------------------------------------*/ | |
71 | |
72 /******************************************************************************/ | |
73 /* Cortex-M4 Processor Exceptions Handlers */ | |
74 /******************************************************************************/ | |
75 | |
76 /** | |
77 * @brief This function handles NMI exception. | |
78 * @param None | |
79 * @retval None | |
80 */ | |
81 void NMI_Handler(void) | |
82 { | |
83 } | |
84 | |
85 /** | |
86 * @brief This function handles Hard Fault exception. | |
87 * @param None | |
88 * @retval None | |
89 */ | |
90 void HardFault_Handler(void) | |
91 { | |
92 /* Go to infinite loop when Hard Fault exception occurs */ | |
42 | 93 HAL_NVIC_SystemReset(); /* TODO Exception occures during startup and no iwdg is active ==> Call reset till iwdg is added */ |
38 | 94 while (1) |
95 { | |
96 } | |
97 } | |
98 | |
99 /** | |
100 * @brief This function handles Memory Manage exception. | |
101 * @param None | |
102 * @retval None | |
103 */ | |
104 void MemManage_Handler(void) | |
105 { | |
106 /* Go to infinite loop when Memory Manage exception occurs */ | |
107 while (1) | |
108 { | |
109 } | |
110 } | |
111 | |
112 /** | |
113 * @brief This function handles Bus Fault exception. | |
114 * @param None | |
115 * @retval None | |
116 */ | |
117 void BusFault_Handler(void) | |
118 { | |
119 /* Go to infinite loop when Bus Fault exception occurs */ | |
120 while (1) | |
121 { | |
122 } | |
123 } | |
124 | |
125 /** | |
126 * @brief This function handles Usage Fault exception. | |
127 * @param None | |
128 * @retval None | |
129 */ | |
130 void UsageFault_Handler(void) | |
131 { | |
132 /* Go to infinite loop when Usage Fault exception occurs */ | |
133 while (1) | |
134 { | |
135 } | |
136 } | |
137 | |
138 /** | |
139 * @brief This function handles SVCall exception. | |
140 * @param None | |
141 * @retval None | |
142 */ | |
143 void SVC_Handler(void) | |
144 { | |
145 } | |
146 | |
147 /** | |
148 * @brief This function handles Debug Monitor exception. | |
149 * @param None | |
150 * @retval None | |
151 */ | |
152 void DebugMon_Handler(void) | |
153 { | |
154 } | |
155 | |
156 /** | |
157 * @brief This function handles PendSVC exception. | |
158 * @param None | |
159 * @retval None | |
160 */ | |
161 void PendSV_Handler(void) | |
162 { | |
163 } | |
164 | |
165 /** | |
166 * @brief This function handles SysTick Handler. | |
167 * @param None | |
168 * @retval None | |
169 */ | |
104 | 170 //void SysTick_Handler(void) |
171 //{ | |
172 // HAL_IncTick(); | |
173 //} | |
38 | 174 |
175 | |
176 /******************************************************************************/ | |
177 /* STM32F4xx Peripherals Interrupt Handlers */ | |
178 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ | |
179 /* available peripheral interrupt handler's name please refer to the startup */ | |
180 /* file (startup_stm32f4xx.s). */ | |
181 /******************************************************************************/ | |
182 /** | |
183 * @brief This function handles I2C event interrupt request. | |
184 * @param None | |
185 * @retval None | |
186 * @Note This function is redefined in "main.h" and related to I2C data transmission | |
187 */ | |
188 void I2Cx_EV_IRQHandler(void) | |
189 { | |
190 HAL_I2C_EV_IRQHandler(& I2cHandle); | |
191 } | |
192 | |
193 /** | |
194 * @brief This function handles I2C error interrupt request. | |
195 * @param None | |
196 * @retval None | |
197 * @Note This function is redefined in "main.h" and related to I2C error | |
198 */ | |
199 void I2Cx_ER_IRQHandler(void) | |
200 { | |
201 HAL_I2C_ER_IRQHandler(& I2cHandle); | |
202 } | |
203 | |
204 | |
205 /** | |
206 * @brief This function handles SPI interrupt request. | |
207 * @param None | |
208 * @retval None | |
209 */ | |
210 | |
211 /* | |
212 void SPI1_IRQHandler(void) | |
213 { | |
214 HAL_SPI_IRQHandler(&hspi1); | |
215 } | |
216 */ | |
217 | |
218 /** | |
219 * @brief This function handles DMA Tx interrupt request. | |
220 * @param None | |
221 * @retval None | |
222 */ | |
223 void DMA2_Stream3_IRQHandler(void) | |
224 { | |
225 HAL_DMA_IRQHandler(hspi1.hdmatx); | |
226 } | |
227 | |
228 /** | |
229 * @brief This function handles DMA Rx interrupt request. | |
230 * @param None | |
231 * @retval None | |
232 */ | |
233 void DMA2_Stream0_IRQHandler(void) | |
234 { | |
235 HAL_DMA_IRQHandler(hspi1.hdmarx); | |
236 } | |
237 | |
238 /** | |
239 * @brief This function handles PPP interrupt request. | |
240 * @param None | |
241 * @retval None | |
242 */ | |
243 | |
662 | 244 void DMA2_Stream5_IRQHandler(void) |
245 { | |
246 HAL_DMA_IRQHandler(&hdma_usart1_rx); | |
247 } | |
248 | |
916
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
662
diff
changeset
|
249 void DMA2_Stream7_IRQHandler(void) |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
662
diff
changeset
|
250 { |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
662
diff
changeset
|
251 HAL_DMA_IRQHandler(&hdma_usart1_tx); |
4832981f9af8
External sensor UART: Switch to DMA TX transfers:
Ideenmodellierer
parents:
662
diff
changeset
|
252 } |
38 | 253 |
988 | 254 #ifdef ENABLE_GNSS_INTERN |
923 | 255 void DMA2_Stream2_IRQHandler(void) |
922 | 256 { |
257 HAL_DMA_IRQHandler(&hdma_usart6_rx); | |
258 } | |
259 | |
260 void DMA2_Stream6_IRQHandler(void) | |
261 { | |
262 HAL_DMA_IRQHandler(&hdma_usart6_tx); | |
263 } | |
264 #endif | |
38 | 265 /******************************************************************************/ |
266 /* STM32F4xx Peripherals Interrupt Handlers */ | |
267 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ | |
268 /* available peripheral interrupt handler's name please refer to the startup */ | |
269 /* file (startup_stm32f4xx.s). */ | |
270 /******************************************************************************/ | |
271 | |
272 | |
273 /** | |
274 * @brief This function handles RTC Auto wake-up interrupt request. | |
275 * @param None | |
276 * @retval None | |
277 */ | |
278 void RTC_WKUP_IRQHandler(void) | |
279 { | |
280 HAL_RTCEx_WakeUpTimerIRQHandler(&RTCHandle); | |
281 } | |
282 | |
283 /** | |
284 * @brief This function handles External line 0 interrupt request. | |
285 * @param None | |
286 * @retval None | |
287 */ | |
288 void EXTI15_10_IRQHandler(void) | |
289 { | |
290 HAL_GPIO_EXTI_IRQHandler(0xFF); | |
291 } | |
292 | |
293 /* button */ | |
294 void EXTI0_IRQHandler(void) | |
295 { | |
296 HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0); | |
297 } | |
298 | |
181 | 299 /* wireless 1 + 2 => was removed from OSTC4 code => placeholder*/ |
38 | 300 void EXTI1_IRQHandler(void) |
301 { | |
302 HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_1); | |
303 } | |
304 | |
305 void EXTI2_IRQHandler(void) | |
306 { | |
307 HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_2); | |
308 } | |
309 | |
310 /* test button */ | |
311 void EXTI3_IRQHandler(void) | |
312 { | |
313 HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3); | |
314 } | |
315 | |
316 /** | |
317 * @brief This function handles ADC interrupt request. | |
318 * @param None | |
319 * @retval None | |
320 */ | |
321 void ADC_IRQHandler(void) | |
322 { | |
323 HAL_ADC_IRQHandler(&AdcHandle); | |
324 } | |
325 | |
662 | 326 |
327 void USART1_IRQHandler(void) | |
328 { | |
329 HAL_UART_IRQHandler(&huart1); | |
330 } | |
331 | |
988 | 332 #ifdef ENABLE_GNSS_INTERN |
922 | 333 void USART6_IRQHandler(void) |
334 { | |
335 HAL_UART_IRQHandler(&huart6); | |
336 } | |
337 #endif | |
338 | |
38 | 339 /** |
340 * @brief This function handles PPP interrupt request. | |
341 * @param None | |
342 * @retval None | |
343 */ | |
344 /*void PPP_IRQHandler(void) | |
345 { | |
346 }*/ | |
347 | |
348 /** | |
349 * @} | |
350 */ | |
351 | |
352 /** | |
353 * @} | |
354 */ | |
355 | |
356 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |