refactor: 重构南向充电控制与参数管理逻辑

1.  apps/chrg/applications/thread/chrg_south.c: 新增支持YM_CAN应答类型处理
2.  apps/chrg/applications/utils/chrg_source.h: 移除冗余的max_vol、protective_curr字段
3.  apps/chrg/applications/utils/chrg_sink.h: 新增OCP测试状态枚举与注释
4.  apps/chrg/applications/thread/chrg_comm.h: 移除废弃的sink_proto_diff_t结构体及相关声明
5.  apps/chrg/applications/thread/chrg_roll_sou.h/.c: 重构南向升级逻辑,新增帧缓存与安全发送机制
6.  apps/chrg/applications/utils/chrg_eload.c: 重构Ymodem应答队列,优化并发访问处理
7.  apps/chrg/applications/utils/chrg_sink.c: 新增OCP测试功能实现与状态切换逻辑
8.  apps/chrg/applications/utils/chrg_source.c: 替换protective_curr为vc.set_current,移除冗余enable标志
9.  apps/chrg/applications/thread/chrg_north.c: 重构电源电压控制逻辑,简化快充输出流程
10. apps/chrg/applications/thread/chrg_comm.c: 全面重构Ymodem升级协议与参数差异处理逻辑
This commit is contained in:
wrh
2026-07-25 10:16:45 +08:00
parent 1fc998f168
commit 4beeb02382
11 changed files with 927 additions and 426 deletions
+1 -2
View File
@@ -211,6 +211,7 @@ enum {
SINK_WORK_SWITCH, // 停止旧电源后进入负载INIT
SINK_WORK_ON_TEST_DYNA,
SINK_WORK_ON_TEST_SHORT,
SINK_WORK_ON_TEST_OCP, // 配置并启动OCP过流保护测试
};
// sink 参数结构
@@ -234,11 +235,9 @@ struct chrg_sink_t {
rt_uint8_t work_mode; // 0=停止 1=工作 2=低电压
};
//纹波寄存器
#define ModbusRTU_Ripple_Value 0x35 //读取纹波
/******************** 负载测试 ************************* */
#define ModbusRTU_CAL_WriteEnable 0x34 //使能写入;0x4361代表使能写入;C+a ASCII码
#define ModbusRTU_Test_CMD 0x4361 //