Browse Source

fix ENET interrupt issue; fix the end address of heap issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@738 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 years ago
parent
commit
a5b48e361e
2 changed files with 12 additions and 3 deletions
  1. 9 0
      bsp/lpc176x/emac.c
  2. 3 3
      bsp/lpc176x/startup.c

+ 9 - 0
bsp/lpc176x/emac.c

@@ -29,8 +29,14 @@ void ENET_IRQHandler(void)
 {
 	rt_uint32_t status;
 
+    /* enter interrupt */
+    rt_interrupt_enter();
+
 	status = LPC_EMAC->IntStatus & LPC_EMAC->IntEnable;
 
+	/* Clear the interrupt. */ 
+	LPC_EMAC->IntClear = status; 
+ 
 	if (status & INT_RX_DONE)
 	{
 		/* Disable EMAC RxDone interrupts. */
@@ -44,6 +50,9 @@ void ENET_IRQHandler(void)
 		/* release one slot */
 		rt_sem_release(&sem_slot);
 	}
+
+    /* leave interrupt */
+    rt_interrupt_leave();
 }
 
 /* phy write */

+ 3 - 3
bsp/lpc176x/startup.c

@@ -85,12 +85,12 @@ void rtthread_startup(void)
 
 #ifdef RT_USING_HEAP
 	#ifdef __CC_ARM
-		rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x10004000);
+		rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x10008000);
 	#elif __ICCARM__
-	    rt_system_heap_init(__segment_end("HEAP"), (void*)0x10004000);
+	    rt_system_heap_init(__segment_end("HEAP"), (void*)0x10008000);
 	#else
 		/* init memory system */
-		rt_system_heap_init((void*)&__bss_end, (void*)0x10004000);
+		rt_system_heap_init((void*)&__bss_end, (void*)0x10008000);
 	#endif
 #endif