change: 时间量上报单位 10ms→50ms, report_counter 入 50ms tick

- report_counter++ 从 5ms ISR 外层移入 if(TM1cnt>=10) 50ms 块
- 3处 misc_value 去掉 /2, 直接差值即可
- REPORT_IDLE_TICKS 120→12, REPORT_EVENT_TICKS 30→3
- 更新 TaskLoop.h/main.c/devlog 注释
This commit is contained in:
wangfq
2026-07-03 10:01:30 +08:00
parent 3c243ea792
commit 85a4fa7910
4 changed files with 41 additions and 17 deletions
+24
View File
@@ -145,10 +145,34 @@ misc_value = (report_counter - passtime_start) / 2;
---
## 2026-07-03 — 时间量上报单位改为 50ms
### 背景
上一步 `misc_value` 以 10ms 为单位(内部 5ms tick `/2`),但协议期望 50ms。统一为 50ms 后与 `Hold_CNT/OUTCNT/INCNT` 一致。
### 方案
1. **`report_counter` 移入 50ms tick 块**:原来在 5ms ISR 外层 `++`,现移到 `if (TM1cnt >= 10)` 内部,每次加 1 = 50ms
2. **去掉 `/2`**`misc_value = report_counter - timestamp`(直接减,无除法)
3. **上报间隔宏同步**`REPORT_IDLE_TICKS 120→12``REPORT_EVENT_TICKS 30→3`
### 影响范围
| 文件 | 变更 |
|------|------|
| `TaskLoop.c` ISR | `report_counter++` 从 5ms 外层移入 50ms 块 |
| `TaskLoop.c` 进场/离场 | 去掉 `/2`,注释 10ms→50ms |
| `TaskLoop.h` | `REPORT_*_TICKS` /10,注释 5ms→50ms |
| `main.c` | 间隔注释更新 |
---
## 修订记录
| 版本 | 时间 | 说明 |
|------|------|------|
| V2.7 | 2026-07-03 | report_counter 改 50ms tick,时间量单位 10ms→50ms |
| V2.6 | 2026-07-03 | misc_value 时间量单位 5ms→10ms |
| V2.5 | 2026-06-29 | 稳定期窗口 100 快速收敛 |
| V2.4 | 2026-06-29 | 去掉快速 IIRALFA_CAP1=79 @10ms |