Browse Source

[FIXUP/PIC] set interrupt status when do traps

Signed-off-by: GuEe-GUI <2991707448@qq.com>
GuEe-GUI 10 months ago
parent
commit
55b40b5164
1 changed files with 4 additions and 0 deletions
  1. 4 0
      components/drivers/pic/pic.c

+ 4 - 0
components/drivers/pic/pic.c

@@ -503,6 +503,8 @@ rt_err_t rt_pic_do_traps(void)
     rt_err_t err = -RT_ERROR;
     struct irq_traps *traps;
 
+    rt_interrupt_enter();
+
     rt_list_for_each_entry(traps, &_traps_nodes, list)
     {
         if (traps->handler(traps->data))
@@ -513,6 +515,8 @@ rt_err_t rt_pic_do_traps(void)
         }
     }
 
+    rt_interrupt_leave();
+
     return err;
 }