fix:[CAN][STM32]open时立刻启动can_start,还未完成其他配置,可能导致异常

This commit is contained in:
wdfk-prog
2024-11-13 22:56:17 -05:00
committed by Meco Man
parent e763e51e49
commit 4c18fa7e21
3 changed files with 20 additions and 10 deletions
+3 -1
View File
@@ -111,7 +111,8 @@ enum CANBAUD
* res = rt_device_control(can_dev, RT_CAN_CMD_SET_FILTER, &cfg);
* RT_ASSERT(res == RT_EOK);
* #endif
*
* res = RT_TRUE;
* res = rt_device_control(can_dev, RT_CAN_CMD_START, &res);
* while (1)
* {
* // hdr 值为 - 1,表示直接从 uselist 链表读取数据
@@ -345,6 +346,7 @@ struct rt_can_ops;
#define RT_CAN_CMD_SET_CANFD 0x1A
#define RT_CAN_CMD_SET_BAUD_FD 0x1B
#define RT_CAN_CMD_SET_BITTIMING 0x1C
#define RT_CAN_CMD_START 0x1D
#define RT_DEVICE_CAN_INT_ERR 0x1000