mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-24 05:04:10 +08:00
[CAN]update struct can_filter_item and rt_can_msg (#6556)
* 修改ry命令,已便于自定义保存路径 * modified: components/utilities/ymodem/ry_sy.c * 修复从被动错误恢复后发送返回异常 * 修复在自动重传模式下,ACK异常阻塞线程 - 删除TX中断函数else分支。仅当RQCP位 置一才进入该中断 - 添加SCE中断函数中关于ACK_ERR的else判断。自动重传模式下会进入该判断,打断自动重传释放完成量。 * 增加对于CAN1与CAN2的SCE中断和TX中断的公共处理函数 * formatting格式化代码 * update struct can_filter_item and rt_can_msg 1. 对过滤器号和索引号结构体定义中同一名称hdr进行重命名hdr_bank和hdr_index, 以便准确区分.采用宏定义兼容以前变量名. 2. 添加接收标识rxfifo,已指明是哪个RXFIFO. * 更正42M下的波特率 * 修复接收获取索引号错误 * 添加接收标识 * 更新注释 * 取消CANFD限制 * update struct can_filter_item and rt_can_msg
This commit is contained in:
@@ -441,14 +441,14 @@ static rt_err_t _can_control(struct rt_can_device *can, int cmd, void *arg)
|
||||
/* get default filter */
|
||||
for (int i = 0; i < filter_cfg->count; i++)
|
||||
{
|
||||
if (filter_cfg->items[i].hdr == -1)
|
||||
if (filter_cfg->items[i].hdr_bank == -1)
|
||||
{
|
||||
drv_can_obj->can_filter_init.CAN_FilterNumber = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* use user-defined filter bank settings */
|
||||
drv_can_obj->can_filter_init.CAN_FilterNumber = filter_cfg->items[i].hdr;
|
||||
drv_can_obj->can_filter_init.CAN_FilterNumber = filter_cfg->items[i].hdr_bank;
|
||||
}
|
||||
|
||||
if (filter_cfg->items[i].mode == 0x00) //CAN_FILTERMODE_IDMASK
|
||||
@@ -725,14 +725,14 @@ static int _can_recv_rtmsg(CAN_TypeDef *can_base, struct rt_can_msg *pmsg, uint3
|
||||
pmsg->rtr = RT_CAN_RTR;
|
||||
}
|
||||
|
||||
/* get hdr */
|
||||
/* get hdr_index */
|
||||
if (can_base == CAN1)
|
||||
{
|
||||
pmsg->hdr = (RxMessage->FMI + 1) >> 1;
|
||||
pmsg->hdr_index = (RxMessage->FMI + 1) >> 1;
|
||||
}
|
||||
else if (can_base == CAN2)
|
||||
{
|
||||
pmsg->hdr = (RxMessage->FMI >> 1) + 14;
|
||||
pmsg->hdr_index = (RxMessage->FMI >> 1) + 14;
|
||||
}
|
||||
/* Release FIFO */
|
||||
CAN_FIFORelease(can_base,FIFONum);
|
||||
|
||||
Reference in New Issue
Block a user