diff options
| author | wdfk-prog <[email protected]> | 2024-11-13 09:18:59 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2024-11-13 22:56:17 -0500 |
| commit | 4c18fa7e21ef1b3fdb781f578855a4693ce5e88a (patch) | |
| tree | 5c288e4a930f1aedc70437f4858ab8cb0e43c527 /components/drivers/include | |
| parent | e763e51e4985bf6bfca1a18965e604b59fc3b984 (diff) | |
fix:[CAN][STM32]open时立刻启动can_start,还未完成其他配置,可能导致异常
Diffstat (limited to 'components/drivers/include')
| -rw-r--r-- | components/drivers/include/drivers/dev_can.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/components/drivers/include/drivers/dev_can.h b/components/drivers/include/drivers/dev_can.h index 4dc28b4f98..aed78b28d3 100644 --- a/components/drivers/include/drivers/dev_can.h +++ b/components/drivers/include/drivers/dev_can.h @@ -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 |
