Browse Source

[N9H30] Fix IRQ trap issues.

1. Fix mismatch IRQ trap issue.
2. Use cond-wait in ge2d driver.
Wayne Lin 4 years ago
parent
commit
37f5236dfa

+ 1 - 1
bsp/nuvoton/libraries/n9h30/rtt_port/drv_ge2d.c

@@ -12,7 +12,7 @@
 #include <drv_sys.h>
 
 //#define DEBUG
-//#define DEF_COND_WAIT 1
+#define DEF_COND_WAIT 1
 
 static unsigned int GFX_BPP;
 static unsigned int GFX_WIDTH;

+ 14 - 10
bsp/nuvoton/libraries/n9h30/rtt_port/drv_sys.c

@@ -48,19 +48,23 @@ void rt_interrupt_dispatch(rt_uint32_t fiq_irq)
     /* Get irq number */
     _mIPER = (inpw(REG_AIC_IPER) >> 2) & 0x3f;
     _mISNR = inpw(REG_AIC_ISNR) & 0x3f;
-    if ((_mIPER != _mISNR) || _mISNR == 0)
-        return;
 
-    /* Get interrupt service routine */
-    isr_func = irq_desc[_mISNR].handler;
-    param = irq_desc[_mISNR].param;
+    if (_mISNR != 0)
+    {
+        if (_mIPER == _mISNR)
+        {
+            /* Get interrupt service routine */
+            isr_func = irq_desc[_mISNR].handler;
+            param = irq_desc[_mISNR].param;
 
-#ifdef RT_USING_INTERRUPT_INFO
-    irq_desc[_mISNR].counter ++;
-#endif
+            #ifdef RT_USING_INTERRUPT_INFO
+                irq_desc[_mISNR].counter ++;
+            #endif
 
-    /* Turn to interrupt service routine */
-    isr_func(_mISNR, param);
+            /* Turn to interrupt service routine */
+            isr_func(_mISNR, param);
+        }
+    }
 
     /* Handled the ISR. */
     outpw(REG_AIC_EOSCR, 1);