From a5b48e361e975d3b9272d77fe87299af3b12e092 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Thu, 27 May 2010 09:43:49 +0000 Subject: [PATCH] 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 --- bsp/lpc176x/emac.c | 9 +++++++++ bsp/lpc176x/startup.c | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bsp/lpc176x/emac.c b/bsp/lpc176x/emac.c index 235a72df2..8d1c370ec 100644 --- a/bsp/lpc176x/emac.c +++ b/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 */ diff --git a/bsp/lpc176x/startup.c b/bsp/lpc176x/startup.c index dce89005a..b517e64ec 100644 --- a/bsp/lpc176x/startup.c +++ b/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