修复了吗?没有,很难的啦

This commit is contained in:
TuxMonkey
2026-03-09 17:47:13 +08:00
parent 79afbaf68d
commit a96e9e939c
3 changed files with 195 additions and 179 deletions

View File

@@ -19,12 +19,12 @@ static float current_energy_j = 0.0f;
// 1. 定义为静态变量static确保它的内存空间常驻防止底层指针悬垂
static XidiPowerMeter_Init_Config_s xidi_pm_config = {
.can_config = {
.can_handle = &hfdcan1, // 原来直接传的句柄,现在放进结构体里
.rx_id = 0x213, // 接收 ID
.tx_id = 0x000, // 发送 ID (不发送填0)
.can_handle = &hfdcan1, // 原来直接传的句柄,现在放进结构体里
.rx_id = 0x213, // 接收 ID
.tx_id = 0x001, // 发送 ID (不发送填0)
},
.daemon_config = {
.reload_count = 5, // 守护进程超时周期 (例如5次没收到算离线)
.reload_count = 5, // 守护进程超时周期 (例如5次没收到算离线)
}
};
@@ -44,6 +44,7 @@ void RobotCMDInit()
LOGINFO("[CMD] Power Meter Init Success!");
}
}
// ==================== 4. 在控制任务中读取使用 ====================
void CmdTask(void *argument)
{
@@ -63,4 +64,4 @@ void CmdTask(void *argument)
osDelay(10); // 根据实际需要调整读取频率
}
}
}