|
15 | 15 | #define LOG_TAG "drv.hwtimer" |
16 | 16 | #include <drv_log.h> |
17 | 17 | #include <rtdevice.h> |
18 | | -#include "drv_hwtimer.h" |
19 | 18 | #include "fsl_ctimer.h" |
20 | 19 |
|
21 | 20 | enum |
@@ -244,39 +243,42 @@ INIT_DEVICE_EXPORT(rt_hw_hwtimer_init); |
244 | 243 | #ifdef BSP_USING_CTIMER0 |
245 | 244 | void CTIMER0_IRQHandler(void) |
246 | 245 | { |
| 246 | + rt_interrupt_enter(); |
247 | 247 | uint32_t int_stat; |
248 | 248 | /* Get Interrupt status flags */ |
249 | 249 | int_stat = CTIMER_GetStatusFlags(CTIMER0); |
250 | 250 | /* Clear the status flags that were set */ |
251 | 251 | CTIMER_ClearStatusFlags(CTIMER0, int_stat); |
252 | 252 | rt_device_hwtimer_isr(&mcxa_hwtimer_obj[TIM0_INDEX].time_device); |
253 | | - |
| 253 | + rt_interrupt_leave(); |
254 | 254 | } |
255 | 255 | #endif /* BSP_USING_HWTIMER0 */ |
256 | 256 |
|
257 | 257 | #ifdef BSP_USING_CTIMER1 |
258 | 258 | void CTIMER1_IRQHandler(void) |
259 | 259 | { |
| 260 | + rt_interrupt_enter(); |
260 | 261 | uint32_t int_stat; |
261 | 262 | /* Get Interrupt status flags */ |
262 | 263 | int_stat = CTIMER_GetStatusFlags(CTIMER1); |
263 | 264 | /* Clear the status flags that were set */ |
264 | 265 | CTIMER_ClearStatusFlags(CTIMER1, int_stat); |
265 | 266 | rt_device_hwtimer_isr(&mcxa_hwtimer_obj[TIM1_INDEX].time_device); |
266 | | - |
| 267 | + rt_interrupt_leave(); |
267 | 268 | } |
268 | 269 | #endif /* BSP_USING_HWTIMER1 */ |
269 | 270 |
|
270 | 271 | #ifdef BSP_USING_CTIMER2 |
271 | 272 | void CTIMER2_IRQHandler(void) |
272 | 273 | { |
| 274 | + rt_interrupt_enter(); |
273 | 275 | uint32_t int_stat; |
274 | 276 | /* Get Interrupt status flags */ |
275 | 277 | int_stat = CTIMER_GetStatusFlags(CTIMER2); |
276 | 278 | /* Clear the status flags that were set */ |
277 | 279 | CTIMER_ClearStatusFlags(CTIMER2, int_stat); |
278 | 280 | rt_device_hwtimer_isr(&mcxa_hwtimer_obj[TIM2_INDEX].time_device); |
279 | | - |
| 281 | + rt_interrupt_leave(); |
280 | 282 | } |
281 | 283 | #endif /* BSP_USING_HWTIMER2 */ |
282 | 284 |
|
|
0 commit comments