对过滤器号和索引号结构体定义中同一名称hdr进行重命名hdr_bank和hdr_index
This commit is contained in:
@ -65,7 +65,7 @@ rt_inline int _can_int_rx(struct rt_can_device *can, struct rt_can_msg *data, in
|
||||
/* disable interrupt */
|
||||
level = rt_hw_interrupt_disable();
|
||||
#ifdef RT_CAN_USING_HDR
|
||||
hdr = data->hdr;
|
||||
hdr = data->hdr_index;
|
||||
|
||||
if (hdr >= 0 && can->hdr && hdr < can->config.maxhdr && !rt_list_isempty(&can->hdr[hdr].list))
|
||||
{
|
||||
@ -581,7 +581,7 @@ static rt_err_t rt_can_control(struct rt_device *dev,
|
||||
{
|
||||
while (count)
|
||||
{
|
||||
if (pitem->hdr >= can->config.maxhdr || pitem->hdr < 0)
|
||||
if (pitem->hdr_bank >= can->config.maxhdr || pitem->hdr_bank < 0)
|
||||
{
|
||||
count--;
|
||||
pitem++;
|
||||
@ -589,15 +589,15 @@ static rt_err_t rt_can_control(struct rt_device *dev,
|
||||
}
|
||||
|
||||
level = rt_hw_interrupt_disable();
|
||||
if (!can->hdr[pitem->hdr].connected)
|
||||
if (!can->hdr[pitem->hdr_bank].connected)
|
||||
{
|
||||
rt_hw_interrupt_enable(level);
|
||||
rt_memcpy(&can->hdr[pitem->hdr].filter, pitem,
|
||||
rt_memcpy(&can->hdr[pitem->hdr_bank].filter, pitem,
|
||||
sizeof(struct rt_can_filter_item));
|
||||
level = rt_hw_interrupt_disable();
|
||||
can->hdr[pitem->hdr].connected = 1;
|
||||
can->hdr[pitem->hdr].msgs = 0;
|
||||
rt_list_init(&can->hdr[pitem->hdr].list);
|
||||
can->hdr[pitem->hdr_bank].connected = 1;
|
||||
can->hdr[pitem->hdr_bank].msgs = 0;
|
||||
rt_list_init(&can->hdr[pitem->hdr_bank].list);
|
||||
}
|
||||
rt_hw_interrupt_enable(level);
|
||||
|
||||
@ -609,7 +609,7 @@ static rt_err_t rt_can_control(struct rt_device *dev,
|
||||
{
|
||||
while (count)
|
||||
{
|
||||
if (pitem->hdr >= can->config.maxhdr || pitem->hdr < 0)
|
||||
if (pitem->hdr_bank >= can->config.maxhdr || pitem->hdr_bank < 0)
|
||||
{
|
||||
count--;
|
||||
pitem++;
|
||||
@ -617,16 +617,16 @@ static rt_err_t rt_can_control(struct rt_device *dev,
|
||||
}
|
||||
level = rt_hw_interrupt_disable();
|
||||
|
||||
if (can->hdr[pitem->hdr].connected)
|
||||
if (can->hdr[pitem->hdr_bank].connected)
|
||||
{
|
||||
can->hdr[pitem->hdr].connected = 0;
|
||||
can->hdr[pitem->hdr].msgs = 0;
|
||||
if (!rt_list_isempty(&can->hdr[pitem->hdr].list))
|
||||
can->hdr[pitem->hdr_bank].connected = 0;
|
||||
can->hdr[pitem->hdr_bank].msgs = 0;
|
||||
if (!rt_list_isempty(&can->hdr[pitem->hdr_bank].list))
|
||||
{
|
||||
rt_list_remove(can->hdr[pitem->hdr].list.next);
|
||||
rt_list_remove(can->hdr[pitem->hdr_bank].list.next);
|
||||
}
|
||||
rt_hw_interrupt_enable(level);
|
||||
rt_memset(&can->hdr[pitem->hdr].filter, 0,
|
||||
rt_memset(&can->hdr[pitem->hdr_bank].filter, 0,
|
||||
sizeof(struct rt_can_filter_item));
|
||||
}
|
||||
else
|
||||
@ -829,7 +829,7 @@ void rt_hw_can_isr(struct rt_can_device *can, int event)
|
||||
level = rt_hw_interrupt_disable();
|
||||
rt_list_insert_before(&rx_fifo->uselist, &listmsg->list);
|
||||
#ifdef RT_CAN_USING_HDR
|
||||
hdr = tmpmsg.hdr;
|
||||
hdr = tmpmsg.hdr_index;
|
||||
if (can->hdr != RT_NULL)
|
||||
{
|
||||
RT_ASSERT(hdr < can->config.maxhdr && hdr >= 0);
|
||||
|
@ -70,7 +70,7 @@ struct rt_can_filter_item
|
||||
rt_uint32_t rtr : 1;
|
||||
rt_uint32_t mode : 1;
|
||||
rt_uint32_t mask;
|
||||
rt_int32_t hdr;
|
||||
rt_int32_t hdr_bank;
|
||||
#ifdef RT_CAN_USING_HDR
|
||||
rt_err_t (*ind)(rt_device_t dev, void *args , rt_int32_t hdr, rt_size_t size);
|
||||
void *args;
|
||||
@ -277,7 +277,7 @@ struct rt_can_msg
|
||||
rt_uint32_t rsv : 1;
|
||||
rt_uint32_t len : 8;
|
||||
rt_uint32_t priv : 8;
|
||||
rt_int32_t hdr : 8;
|
||||
rt_int32_t hdr_index : 8;
|
||||
#ifdef RT_CAN_USING_CANFD
|
||||
rt_uint32_t fd_frame : 1;
|
||||
rt_uint32_t reserved : 7;
|
||||
|
Reference in New Issue
Block a user