2b466b85f0
New read-only content page under 实时数据 → 开入开出 showing the board's
8 opto inputs (DI_A..DI_H, 合/分) and 4 relay outputs (KO6/TRIP/ERT/CLZ,
吸合/释放) as a 12-row list, 8 rows per page, 2 pages.
Data path reuses the existing de-bounced input poll instead of adding a
second hardware reader:
defaultTask (50 ms) → ioboard_di_snap_publish() → de-bounced snapshot
→ ioboard_di_snap_lookup() [new registration channel]
→ ui_data_feed_tick() (uiTask, 200 ms)
→ ui_data_rt_t.dio_di_* / dio_do_*
No new critical sections, no new hardware access on the UI path. Outputs
come from the volatile shadow register (a memory read, no lock).
Semantic honesty, recorded in ui_page_di_do.c and README §6:
· Output state is the software shadow register (ODR mirror), NOT a
mechanical contact feedback — this platform has no auxiliary contact
readback path. ioboard_do_read_level() also reads ODR, so comparing
the two is tautological.
· IOBOARD_DO_LEVEL_ACTIVE polarity has not been checked against the
schematic.
· Input bit order has not been verified by manual shorting. The
2026-11-16 run read 0x00 eight times because the operator had no time
to short each channel — the data path itself was fine.
· Board-level inputs are deliberately kept out of the 33-point telemetry
bitmap (IEC 104 point-table semantics); the two have no mapping.
Invalid snapshots render "--", never 合/分 or 吸合/释放: painting "no data"
as "all inputs released" would tell the field the inputs are open when we
simply failed to read them.
Board-verified 2026-11-16: page 1 shows 分 on all 8 inputs, page 2 shows
释放 on all 4 outputs, page footer and paging correct. Input bit order
still pending manual shorting.
Also: regenerate ui_font_cn_12 for 吸/释, add golden references for both
pages, align check_menu_rows.py L2 geometry with the now-4-item submenu,
and register the new source file in both the Keil project and CMake.
Reviewed independently; zero blocking findings.
App/task/ — FreeRTOS 任务实现
6 个任务的入口函数与任务体。任务创建在
Src/freertos.c(MX_FREERTOS_Init), 栈大小/优先级的唯一事实源也是Src/freertos.c;本目录只放任务实现。
任务清单
| 文件 | 任务 | 优先级 | 职责 |
|---|---|---|---|
default_task.c/h |
defaultTask | Normal | FTL + FatFS 挂载、配置引擎属主、syslog 唯一写者、LED 指示 |
net_task.c/h |
netTask | Normal | net_stack_bring_up → 置 NET_READY → 循环 net_poll + net_process_messages |
ui_task.c/h |
uiTask | BelowNormal | LVGL 界面(菜单 / 内容页 / 待机)+ 推流 |
adc_task.c/h |
adcTask | AboveNormal | ADC 采集消费:TPAFE5160 快照 + 消费 STM32 ADC1 DMA 乒乓缓冲一帧,经 ../algo/adc_input.c 按语义取数(采样节拍由 TIM3 硬件触发) |
rs485_task.c/h |
(RS-485 任务) | — | 半双工 RS-485 协议通信 |
../sync/time_sync.c |
timeSyncTask | Normal | 墙钟时间同步(实现不在本目录,见 ../sync/README.md) |
上表栈大小/优先级以
Src/freertos.c为准(README.md的任务表由scripts/gen_task_table.py生成,勿手抄)。
就绪屏障(重要)
任务间不用魔法延时,改用 App/app/sys_events.h 的 Event Flags:
SYS_EVT_NET_READY/SYS_EVT_STORAGE_READY等是状态位——等待时必须osFlagsWaitAny|osFlagsNoClear,不能用默认消费型等待(否则先到的消费者会清掉位, 导致ftpTask的WaitAll(两位)永不成立 → FTP 静默不监听)SYS_EVT_CFG_SAVE/SYS_EVT_NET_RECONFIG等命令位保持消费型等待
平台约束(改本目录前必读)
- 内核启动前禁止任何 FreeRTOS/CMSIS-RTOS API 调用(
osMessageQueueNew等会杀死启动) - 就绪屏障位一律用
osFlagsNoClear - 内存预算紧张,改栈/缓冲前先核算(
docs/内存管理/)
相关文档
- 启动顺序与屏障:
docs/架构设计/项目启动顺序管理.md - 内存与定栈规则:
docs/内存管理/RAM使用分析与优化方案.md - 栈水位实测:
scripts/stack_report.py