fix(vd960Loop): init_vd_single 灵敏度从配置读, 不再硬编码 2

现场日志: 配置 SENS=3/2/1/0, 检测全用 sens_in:36 (SENS=2 表值)

根因: main→para_store_init() 同步 loop_SensLevel=配置, 但任务启动后
INIT_VDs()→init_vd_single() 硬编码 loop_SensLevel=2 覆盖配置 → 全通道 SENS=2

修复: init_vd_single 改为 sens_level_from_config(
  g_loop_cng_info.loop_cng[unit->loop_num].sensitvity)

另: flash 灵敏度表 sens[0]={512,400} 为坏数据(出厂应为{216,108}),
修复后 loop_3(SENS=0) 会撞上异常值, 需恢复出厂清配置区
This commit is contained in:
wangfq
2026-08-25 14:23:33 +08:00
parent bbf5492fe2
commit af95660c68
2 changed files with 16 additions and 1 deletions
+14
View File
@@ -39,6 +39,20 @@
gcc 单测 PASS0→0, 1→1, 2→2, 3→3 无折叠;`7&0x0F → 3` 兼容旧默认。实机待金属块复测(建议小金属块测临界感应高度)。 gcc 单测 PASS0→0, 1→1, 2→2, 3→3 无折叠;`7&0x0F → 3` 兼容旧默认。实机待金属块复测(建议小金属块测临界感应高度)。
### 补充根因(同日):INIT_VDs 硬编码覆盖配置 + flash 坏数据
现场串口日志(`Read_Cng_Store`)显示:配置 4 通道 SENS=3/2/1/0,但检测时 `Car_In` 全部打印 `sens_in:36`(SENS=2 表值)——4 通道检测全用 SENS=2。定位两个根因:
**`init_vd_single()` 硬编码 `loop_SensLevel = 2`TaskLoop.c:111**
时序:`main → para_store_init()`(同步 loop_SensLevel=配置)→ 任务启动 → `INIT_VDs()``init_vd_single()` **把 loop_SensLevel 重置为 2**,覆盖配置值 → 全通道 SENS=2。
修复:`init_vd_single` 改为从配置读——`sens_level_from_config(g_loop_cng_info.loop_cng[unit->loop_num].sensitvity)`unit->loop_num 由 INIT_VDs 先设置)。
**② flash 灵敏度表 sens[0]={512,400} 坏数据**
解析 `Read_Cng_Store` flash 数据(0x40 起小端 2B):`{512,400},{108,72},{36,18},{10,9}`——出厂默认应为 `{216,108},...`sens[0] 被写成 512/400(非正常值)。修复 ① 后 loop_3(SENS=0)会撞上 512 → dlt≈281 异常灵敏。**需恢复出厂(test_factory/清配置区)重新写入出厂表。**
--- ---
## 2026-08-25 — variation ↔ ΔL/ΔL-L 物理对应分析与工具 ## 2026-08-25 — variation ↔ ΔL/ΔL-L 物理对应分析与工具
@@ -108,7 +108,8 @@ void init_vd_single(Loop154_Unit *unit)
unit->loop_CAP_OK = 0; unit->loop_CAP_OK = 0;
unit->loop_CAPVD = 0; unit->loop_CAPVD = 0;
unit->loop_SensLevel = 2; // 默认中灵敏度 unit->loop_SensLevel = sens_level_from_config(
g_loop_cng_info.loop_cng[unit->loop_num].sensitvity); // 从配置读, 不再硬编码 2 (修复: INIT_VDs 覆盖配置值)
unit->Flt_Reg = ALFA_CAP1; unit->Flt_Reg = ALFA_CAP1;
unit->loop_entry_cnt = 0; unit->loop_entry_cnt = 0;