feat(opt): 光耦输出模式完整实现 — 6种融合逻辑 + 人车混行/ETC 状态机

- 新增 g_opt_trigger 全局变量:opt_input_poll() 产出, TMR1 ISR 消费
- MODE 1/2/3/4: 纯地感/纯雷达/或/与 — g_opt_trigger 直出光耦信号
- MODE 5 (HUMAN_VD_MIX): 3态机 IDLE→ARMED→WINDOW, 3s防砸窗口
- MODE 6 (ETC): 3态机 IDLE→ARMED→DEBOUNCE, 500ms防抖释放
- TMR1 ISR case 0: 6模式融合判决 (coil || opt_trigger / coil && opt_trigger等)
- 光耦防抖: 3样本多数表决, ~30ms消抖
- MODE 0 复位逻辑不变
- docs: 更新开发日志 (状态机图 + 各模式对照表)
This commit is contained in:
wangfq
2026-07-28 09:34:18 +08:00
parent f5edab43c2
commit 978cce4af8
3 changed files with 257 additions and 20 deletions
@@ -43,6 +43,7 @@ extern uint8_t g_loop_power_up_state;
extern uint8_t g_function_mode;
extern uint8_t g_fm_700bs_disable ; //0: 700bs protocol; 1 Modbus protocol
extern uint8_t g_output_radar_mode;
extern uint8_t g_opt_trigger; // 光耦/雷达 处理后触发信号 (1=有效)
/* 新算法状? (DLD154V4B 移植) */
extern uint8_t g_loop_stable; // 稳定期结束标? (0=收敛?, 1=稳定)