12e0617909
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.
54 lines
1.9 KiB
C
54 lines
1.9 KiB
C
/*
|
|
* 模块名称:UI Network Sink Backend (MCU 实现)
|
|
* 模块功能:RemoDispBus 服务端在 MCU 端的平台相关操作——
|
|
* 读取 LVGL 帧缓冲(LCDMEM 数据源)与经 ui_port 注入远端按键
|
|
* 适用平台:STM32F407ZGTx
|
|
* 作者:王建锋
|
|
* 创建日期:2026-09-10
|
|
* 修改记录:
|
|
* 2026-09-10 王建锋 创建初始版本(双端共用 ui_net_sink 的平台后端)
|
|
*/
|
|
#include "ui_net_sink_backend.h"
|
|
|
|
#include <string.h>
|
|
|
|
#include "ui_port.h"
|
|
|
|
/*
|
|
* 函数功能:读取 LVGL 帧缓冲为 1bpp 位图(LCDMEM 数据源)
|
|
* 入口参数:out - 输出缓冲(≥ UI_NET_SINK_MONO_SIZE 字节)
|
|
* out_size - out 容量(字节)
|
|
* 返回值:0 - 成功,-1 - 参数或帧缓冲无效
|
|
* 限定条件:ui_port_init() 已成功
|
|
* 函数说明:帧缓冲本就是 1bpp 且**已是纯像素**(无 palette),直接整帧拷贝。
|
|
* 注意:不要改成直接读 LVGL 绘制缓冲 g_ui_draw_buf——那是索引色
|
|
* [palette 8B][pixel data] 布局(见 ui_port.h),首 8 字节是调色板,
|
|
* 直接拷会让推流画面整体错位 8 字节;flush 回调已跳过 palette 写入本缓冲。
|
|
*/
|
|
int ui_net_sink_get_lcdmem(uint8_t *out, uint32_t out_size) {
|
|
const uint8_t *fb;
|
|
|
|
if (out == NULL || out_size < UI_NET_SINK_MONO_SIZE) {
|
|
return -1;
|
|
}
|
|
|
|
fb = ui_port_get_framebuffer();
|
|
if (fb == NULL) {
|
|
return -1;
|
|
}
|
|
|
|
memcpy(out, fb, UI_NET_SINK_MONO_SIZE);
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* 函数功能:向 UI 输入队列注入一个远端按键
|
|
* 入口参数:remo_key - 远端按键码(UI_KEY_* 之一)
|
|
* 返回值:无
|
|
* 限定条件:无
|
|
* 函数说明:缓存后由 keypad 读取回调在下次轮询上报(键码映射在 ui_port 内完成)
|
|
*/
|
|
void ui_net_sink_inject_key(uint8_t remo_key) {
|
|
ui_port_queue_key(remo_key);
|
|
}
|