summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2015-06-17 15:01:48 +0800
committerBernard Xiong <[email protected]>2015-06-17 15:01:48 +0800
commit562ac32e322faa38521087daa5370324320cd7d8 (patch)
tree349d0a82e9a1916d12ecddc8156946c842bd7c8c /components
parent2fc33973de23bbc32701e0d2db17a204bf9e405f (diff)
parent70aedb7a3436be153e6df25bd082f1edeb5f8e04 (diff)
Merge pull request #504 from AubrCool/fix-can.drv.errors
Fix can.drv.errors
Diffstat (limited to 'components')
-rw-r--r--components/drivers/can/can.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/drivers/can/can.c b/components/drivers/can/can.c
index 8ac3029533..c31523c1a0 100644
--- a/components/drivers/can/can.c
+++ b/components/drivers/can/can.c
@@ -65,7 +65,7 @@ rt_inline int _can_int_rx(struct rt_can_device *can, struct rt_can_msg *data, in
can->hdr[hdr].msgs--;
}
listmsg->owner = RT_NULL;
- } else
+ } else if(hdr == -1)
#endif /*RT_CAN_USING_HDR*/
if (!rt_list_isempty(&rx_fifo->uselist))
{
@@ -97,6 +97,8 @@ rt_inline int _can_int_rx(struct rt_can_device *can, struct rt_can_msg *data, in
RT_ASSERT(rx_fifo->freenumbers <= can->config.msgboxsz);
rt_hw_interrupt_enable(level);
listmsg = RT_NULL;
+ } else {
+ break;
}
data ++; msgs -= sizeof(struct rt_can_msg);
}