فهرست منبع

Fix bug when restarting and getting interrupts that are not processed. (#5997)

Reason: Interrupts were not cleaned up during initialization
Freey0 3 سال پیش
والد
کامیت
532180dc19
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c

+ 5 - 2
bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c

@@ -106,8 +106,11 @@ void rt_hw_interrupt_init(void)
 {
     int i;
 
-    *((volatile unsigned int *)REG_AIC_INTDIS0) = 0xFFFFFFFF;   // disable all interrupt channel
-    *((volatile unsigned int *)REG_AIC_INTDIS1) = 0xFFFFFFFF;   // disable all interrupt channel
+    outpw(REG_AIC_INTDIS0, 0xFFFFFFFF); // disable all interrupt channel
+    outpw(REG_AIC_INTDIS1, 0xFFFFFFFF); // disable all interrupt channel
+
+    outpw(REG_AIC_EOIS, 1);     // resetand restart AIC's IRQ processing
+    outpw(REG_AIC_EOFS, 1);     // resetand restart AIC's IRQ processing
 
     /* init interrupt nest, and context in thread sp */
     rt_interrupt_nest               = 0;