From fcef87e7df79f39e9edf63593351f8f0d325e69d Mon Sep 17 00:00:00 2001 From: kyz Date: Fri, 14 Nov 2025 09:38:47 +0800 Subject: [PATCH] modify can parameter --- src/user_can.c | 7 +++++-- src/user_pcs.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/user_can.c b/src/user_can.c index 686b5ff..e0f531a 100644 --- a/src/user_can.c +++ b/src/user_can.c @@ -55,9 +55,12 @@ int can_bus_init(int bus_id) { const char *ifname = can_bus_configs[bus_id].interface_name; uint32_t bitrate = can_bus_configs[bus_id].bitrate; - // 设置CAN接口参数 char command[256]; - snprintf(command, sizeof(command), "ip link set %s type can bitrate %u", ifname, bitrate); + + printf( "can bus init, ifname:%s, bitrate:%d --- \n", ifname, bitrate ); + // 设置CAN接口参数 + + snprintf(command, sizeof(command), "ip link set %s type can bitrate %u dbitrate %u fd on", ifname, bitrate, bitrate ); if (execute_system_command(command) < 0) { return -1; } diff --git a/src/user_pcs.c b/src/user_pcs.c index 22b053c..194666c 100644 --- a/src/user_pcs.c +++ b/src/user_pcs.c @@ -739,7 +739,7 @@ static void* pcs_task_thread(void* arg) // 初始化Modbus总线 if (mb_bus_init() != 0) { fprintf(stderr, "Failed to initialize modbus access module\n"); - return NULL; + //return NULL; } // 定义寄存器区域 -- 2.34.1