diff --git a/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c b/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c index 784b83d..c0bbf49 100644 --- a/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c +++ b/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c @@ -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 } }