Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion components/drivers/can/dev_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,15 +968,19 @@ rt_err_t rt_hw_can_register(struct rt_can_device *can,
*/
void rt_hw_can_isr(struct rt_can_device *can, int event)
{
rt_bool_t is_rxof_event = RT_FALSE;

switch (event & 0xff)
{
case RT_CAN_EVENT_RXOF_IND:
{
rt_base_t level;
is_rxof_event = RT_TRUE;
level = rt_hw_local_irq_disable();
can->status.dropedrcvpkg++;
rt_hw_local_irq_enable(level);
}
/* FALLTHROUGH: RX overflow still tries to fetch one pending frame into software FIFO. */
case RT_CAN_EVENT_RX_IND:
{
struct rt_can_msg tmpmsg;
Expand Down Expand Up @@ -1020,7 +1024,10 @@ void rt_hw_can_isr(struct rt_can_device *can, int event)
else if (!rt_list_isempty(&rx_fifo->uselist))
{
listmsg = rt_list_entry(rx_fifo->uselist.next, struct rt_can_msg_list, list);
can->status.dropedrcvpkg++;
if (!is_rxof_event)
{
can->status.dropedrcvpkg++;
}
rt_list_remove(&listmsg->list);
#ifdef RT_CAN_USING_HDR
rt_list_remove(&listmsg->hdrlist);
Expand Down
Loading