fix: 有限存在超时改为通道完整重启, 避免继电器立即重新吸合
原逻辑设 loop_FLAG_OUT=1 触发正常离车流程, 但线圈物理上仍有车, vd1_task 立刻重新检测到有车→继电器又吸合。 改为与安全复位一致的重启逻辑: - LC_Reset=1, loop_INI_LOOP=1 → 强制重新初始化 - loop_stable=0, loop_LOOP_OK0=0 → 重建基线(含稳定期128样本) - 清除所有标志位和计数器 - 移除 loop_VD_FLAG 前置条件 (set_loops_relay_off 无条件执行)
This commit is contained in:
@@ -292,20 +292,29 @@ void TMR15_GLOBAL_IRQHandler(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* 有限存在超时 */
|
||||
/* 有限存在超时 — 通道重启,重新建立基线 */
|
||||
if (unit->loop_VD_HOLD) {
|
||||
unit->Hold_CNT++;
|
||||
if (unit->Hold_CNT > unit->hold_time) {
|
||||
unit->loop_VD_HOLD = 0;
|
||||
unit->Hold_CNT = 0;
|
||||
if (unit->loop_VD_FLAG) {
|
||||
set_loops_relay_off(unit->loop_num);
|
||||
unit->loop_VD_FLAG = 0;
|
||||
unit->loop_FLAG_OUT = 1;
|
||||
unit->LC_HOLD = 0;
|
||||
unit->loop_ORG_CNT = 0;
|
||||
unit->loop_ORG_SUM = 0;
|
||||
}
|
||||
set_loops_relay_off(unit->loop_num);
|
||||
unit->loop_VD_FLAG = 0;
|
||||
unit->loop_FLAG_IN = 0;
|
||||
unit->loop_FLAG_OUT = 0;
|
||||
unit->loop_FLAG_PLUSE = 0;
|
||||
unit->LC_HOLD = 0;
|
||||
unit->LC_Reset = 1;
|
||||
unit->loop_INI_LOOP = 1;
|
||||
unit->loop_LOOP_OK0 = 0;
|
||||
unit->loop_stable = 0;
|
||||
unit->loop_ORG_CNT = 0;
|
||||
unit->loop_ORG_SUM = 0;
|
||||
#if USE_FLATNESS_EXIT
|
||||
unit->exit_state = 0;
|
||||
unit->max_slope = 0;
|
||||
unit->max_slope_rate = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user