diff options
| author | bernard.xiong <[email protected]> | 2009-12-10 16:04:03 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2009-12-10 16:04:03 +0000 |
| commit | a7b56e9c45d78b1906ce1cd524e4c0799ab95d71 (patch) | |
| tree | 3dc5a3e322578b08f00938b1551086d8782447c5 /bsp | |
| parent | 729a0f451694145a66f16bde211ac3b19263182d (diff) | |
update dm9000a driver
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@195 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/stm32_radio/dm9000.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bsp/stm32_radio/dm9000.c b/bsp/stm32_radio/dm9000.c index 598e44b350..9a8569d87d 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 */
|
