From a7b56e9c45d78b1906ce1cd524e4c0799ab95d71 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Thu, 10 Dec 2009 16:04:03 +0000 Subject: [PATCH] update dm9000a driver git-svn-id: https://rt-thread.googlecode.com/svn/trunk@195 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/stm32_radio/dm9000.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bsp/stm32_radio/dm9000.c b/bsp/stm32_radio/dm9000.c index 598e44b35..9a8569d87 100644 --- a/bsp/stm32_radio/dm9000.c +++ b/bsp/stm32_radio/dm9000.c @@ -175,12 +175,11 @@ void rt_dm9000_isr() /* Received the coming packet */ if (int_status & ISR_PRS) { - rt_err_t result; + /* disable receive interrupt */ + dm9000_device.imr_all = IMR_PAR | IMR_PTM; /* a frame has been received */ - result = eth_device_ready(&(dm9000_device.parent)); - if (result != RT_EOK) rt_kprintf("eth notification failed\n"); - RT_ASSERT(result == RT_EOK); + eth_device_ready(&(dm9000_device.parent)); } /* Transmit Interrupt check */ @@ -459,7 +458,7 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev) rt_sem_take(&sem_lock, RT_WAITING_FOREVER); /* Check packet ready or not */ - dm9000_io_read(DM9000_MRCMDX); /* Dummy read */ + dm9000_io_read(DM9000_MRCMDX); /* Dummy read */ rxbyte = DM9000_inb(DM9000_DATA_BASE); /* Got most updated data */ if (rxbyte) { @@ -560,8 +559,9 @@ struct pbuf *rt_dm9000_rx(rt_device_t dev) } else { - /* restore interrupt */ - // dm9000_io_write(DM9000_IMR, dm9000_device.imr_all); + /* restore receive interrupt */ + dm9000_device.imr_all = IMR_PAR | IMR_PTM | IMR_PRM; + dm9000_io_write(DM9000_IMR, dm9000_device.imr_all); } /* unlock DM9000 device */ -- GitLab