This commit is contained in:
2026-03-10 03:05:49 +08:00
parent a9ac56dc52
commit d6872ad1e8
4 changed files with 114 additions and 58 deletions

View File

@@ -170,11 +170,14 @@ void ChassisInit()
SuperCap_Init_Config_s cap_conf = {
.can_config = {
.can_handle = &hcan2,
.tx_id = 0x302, // 超级电容默认接收id
.rx_id = 0x301, // 超级电容默认发送id,注意tx和rx在其他人看来是反的
.can_handle = &hcan2, // 保持你原有的硬件CAN接口不变
.tx_id = 0x001, // C板发给超级电容的ID
.rx_id = 0x100, // 超级电容发给C板的ID
}};
cap = SuperCapInit(&cap_conf); // 超级电容初始化
cap = SuperCapInit(&cap_conf); // 超级电容初始化 todo 控制
// (新增)设置超级电容功率补偿,例如补偿5W,可根据实际需求调整
SuperCapSetPowerOffset(cap, 5);
// 发布订阅初始化,如果为双板,则需要can comm来传递消息
#ifdef CHASSIS_BOARD