feat(V4B): Debug串口打印重组 — 频率/采样/基准全量输出 (V4.20)

现场有影响算法的异常待分析, 扩充调试输出:
1. 周期状态行(2s, DBG|前缀): f频率kHz/Xn/LPCNT/Value/CAPVD/slow/Origin/dlt/SENS/VD/FRZ/LIM/LOOP/STBL
   - calc_freq_khz(): f=60000×LPCNT/CAPVD (60MHz捕获时钟, 无车≈99kHz/深车124kHz验证✓)
   - g_slope_limit_cnt: 斜率限幅截断计数(EMI线索, 周期清零)
2. 事件行(EVT|前缀): enter_try(进入线首中)/leave_try(离开线首中)/loop_disconnect/loop_reconnect
   - 原有 Car_In/Car_OFF/Loop stable/Baseline timeout 保留
3. cmcng.h 新增 DEBUG_ENABLE 开关(1=开现场分析 0=关发布)

文档: devlog V2.18
This commit is contained in:
wangfq
2026-09-02 09:49:24 +08:00
parent 5b0a4c26d7
commit 278d470b60
3 changed files with 103 additions and 7 deletions
@@ -26,6 +26,14 @@
#include <stdint.h>
#ifndef DEBUG_ENABLE
#define DEBUG_ENABLE 1 // 1=调试串口打印开启(现场分析) 0=关闭(发布), V4.20
#endif
#if DEBUG_ENABLE
#ifndef DEBUG
#define DEBUG
#endif
#endif
#ifdef DEBUG
#define PRINT(X...) printf(X)
#else