refactor: 新增 misc_counter 替代 report_counter 做时间戳

- Loop154_States 新增 misc_counter (50ms 自由运行不复位)
- 7处时间戳操作改用 misc_counter: passtime_start/last_exit_tick/misc_value
- report_counter 还原原始清零逻辑, 仅管上报间隔
- 删除 last_report_tick

这样 report_counter 只管上报调度, misc_counter 只管时间戳,
互不干扰, 即使 report_counter 清零也不影响车间距/通过时间计算
This commit is contained in:
wangfq
2026-07-03 10:33:48 +08:00
parent b49797ecc6
commit 5aa8edc1ea
3 changed files with 13 additions and 12 deletions
@@ -429,7 +429,7 @@ void uart_report_packet_loop_acs(uint8_t flag)
} else {
_interval = REPORT_IDLE_TICKS; // 12×50ms = 600ms
}
if ((g_loop_states.report_counter - g_loop_states.last_report_tick) < _interval) return;
if (g_loop_states.report_counter < _interval) return;
/*--- 3. 确定本轮杂项类型 ---*/
if (_flag_event) {
@@ -526,7 +526,7 @@ void uart_report_packet_loop_acs(uint8_t flag)
g_pkg_uart_report.pkg[i++] = _sum & 0xFF;
usart1_sendstring(g_pkg_uart_report.pkg, i);
g_loop_states.last_report_tick = g_loop_states.report_counter;
g_loop_states.report_counter = 0;
}
@@ -1062,7 +1062,7 @@ void TMR6_GLOBAL_IRQHandler(void)
}
}
g_loop_states.last_report_tick = g_loop_states.report_counter;
g_loop_states.report_counter = 0;
}