Browse Source

fix interrupt repeat bug.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1633 bbd45198-f89e-11dd-88c7-29a3b14d5316
wuyangyong 14 years ago
parent
commit
5b063d3030
1 changed files with 4 additions and 3 deletions
  1. 4 3
      libcpu/arm/s3c24x0/trap.c

+ 4 - 3
libcpu/arm/s3c24x0/trap.c

@@ -151,14 +151,15 @@ void rt_hw_trap_irq()
 
 	if (intstat == INTGLOBAL) return;
 
-	/* clear pending register */
-	ClearPending(1 << intstat);
-	
 	/* get interrupt service routine */
 	isr_func = isr_table[intstat];
 
 	/* turn to interrupt service routine */
 	isr_func(intstat);
+
+	/* clear pending register */
+	/* note: must be the last, if not, may repeat*/
+	ClearPending(1 << intstat);
 }
 
 void rt_hw_trap_fiq()