Files
STM32F4-Base/Drivers/BSP/UI
wandering1 12e0617909 fix(gates): close the BOM gate hole that let new files skip the check
The BOM gate claimed to stop BOMs from being stripped, but it only ever
inspected files that were already tracked AND already had a BOM. A new
file under a BOM-listed directory could be born without one and never
be noticed, because the scan never returned it and, even if it had, the
"no HEAD version" branch skipped it. Editing a listed file and losing
its BOM is a real accident that already happened once; creating one
without a BOM was the same accident with no safety net at all.

Measured before and after on the same untracked file with no BOM:

  before: checked 101 files, no drift, exit 0
  after:  FAIL, names the file, exit 1

The count of 101 was itself the symptom: with one more file present the
honest number is 102. The old code was not "silently passing a clean
tree", it was not looking.

The scan now includes untracked files, and a listed file with no HEAD
version must carry a BOM. Files that are tracked without a BOM keep
their historical pass so this does not flood existing code with
failures; instead the two that were listed but had no BOM were given one
so the list means what it says.

That exposed a conflict nobody had hit yet. The font file is generated,
and the generator rewrites it from scratch on every run, so a hand-added
BOM survived until the next regeneration and then vanished. The BOM gate
and the generated-fresh gate could not both pass. The generator now puts
the BOM back as its last step, idempotently, so the two gates agree and
the whole UI directory keeps its uniform encoding. Font content is
untouched: everything after the first three bytes is byte-identical.

The menu generator gains a real read-only mode. It previously had no
options at all and always rewrote its outputs; the arrows it printed
were accurate. That made it easy to mistake for a checker, since an
unchanged tree produces identical bytes and looks untouched. --check now
reports up to date or stale without writing anything, and the
registration tables are checked the same way. Default behaviour and
output are unchanged.

The telemetry page header no longer restates the board's input hardware
facts. They live in the IOBOARD README, which is where the board's
electrical behaviour belongs; the page keeps only what it alone can say:
that the output rows show the shadow register rather than contact
feedback, why an invalid sample draws -- instead of 分, and that these
twelve rows are not in the point table. One fact, one place.

The team rule for experiments now requires the file hash, the located
line number, and both runs. A report once cited a line number that did
not exist in the final file, which left no way to confirm which version
had actually been tested.
2026-11-16 23:59:49 +08:00
..
2026-09-09 17:15:04 +08:00
2026-09-10 11:36:33 +08:00

Drivers/BSP/UI/ — LVGL UI 组件

基于 LVGL 的界面实现:菜单树、内容页、通用组件、中文字库、待机页。 与 PC 模拟器共用同一套 UI 源码(simulator/ 只提供平台层)。

结构

核心 / 框架

文件 作用
ui_port.c/h LVGL 移植层:显示驱动、输入设备、tick 注册
ui_menu.c/h 菜单框架(树结构与导航)
ui_menu_view.c/h 菜单视图渲染
ui_menu_tab.c/h 页签组件
ui_deco.c/h 界面装饰元素(图标、边框等)
ui_standby.c/h 待机页
ui_pwd_def.h 密码页默认值定义
ui_font_cn_12.c 中文字库(由 tools/font_gen/ 生成,勿手改)

内容页

文件 作用
ui_content_page.c/h 内容页框架
ui_page_ac.c/h 交流量页
ui_page_dc.c/h 直流量页
ui_page_device_info.c/h 设备信息页
ui_page_net_cfg.c/h 网口设置页
ui_page_password.c/h 密码页
ui_page_runlog.c/h 运行日志页
ui_page_selftest.c/h 自检页

数据汇入(推流)

文件 作用
ui_net_sink.c/h 远端显示总线(RemoDispBus)数据汇入口
ui_net_sink_backend.h 后端抽象接口(MCU / 模拟器分别实现)
ui_net_sink_backend_mcu.c MCU 端后端实现

⚠️ 编码注意(本目录含中文字符串)

  • 本目录文件带 UTF-8 BOM(.c 内含中文字符串字面量,BOM 使 ARMCC 按 UTF-8 解码)
  • Edit 工具会剥掉 BOM:改完必须核对并按原样补回 3 字节 EF BB BF, 否则 ARMCC 改按 CP936 解读 → #870-D: invalid multibyte character sequence
  • UI 改动一律走 ui-verify skill 五步门禁
  • 含新汉字的文案提交前先跑 font-regen skill 重生成 ui_font_cn_12.c

相关文档

  • UI 架构:docs/UI设计/UI_设计架构.md
  • 菜单设计:docs/UI设计/菜单页面设计.md、docs/UI设计/内容页架构.md
  • 字体:docs/UI设计/UI_中文字体生成与配置.md
  • 模拟器:docs/UI设计/LVGL模拟器部署与使用说明.md
  • 自动化测试:docs/UI设计/UI_自动化测试流程.md
  • 协议:docs/UI设计/RemoDispBus协议与接收设计说明.md