fix: report_counter 清零导致车间距/通过时间下溢 (0xFFFFFFxx)

根因: report_counter 清零后 last_exit_tick/passtime_start 存旧值,
     再次进场时差值下溢 uint32_t → 0xFFFFFFF7

修复:
- Loop154_States 新增 last_report_tick, report_counter 自由运行不复位
- report_misc: 增量判断 (report_counter - last_report_tick) >= _interval
- TMR6 ISR: 用 last_report_tick 实现 UART 期间推迟上报, 不再清零
- 删掉所有 g_loop_states.report_counter = 0
This commit is contained in:
wangfq
2026-07-03 10:27:56 +08:00
parent 85a4fa7910
commit b49797ecc6
2 changed files with 5 additions and 4 deletions
@@ -190,7 +190,8 @@ typedef struct {
* 全局状态
*===========================================================================*/
typedef struct {
uint32_t report_counter; // 上报间隔计数器 (50ms tick)
uint32_t report_counter; // 上报间隔计数器 (50ms tick, 自由运行不复位)
uint32_t last_report_tick; // 上次上报时刻, 用于增量判断
uint8_t report_misc_round; // 空闲轮转: 0=MISC_TYPE_TIME, 1=CUT, 2=FLOW, 3=RELAY
Loop154_Unit loop_unit[LOOP_CAPTURE_MAX];
} Loop154_States;