通用配置文件 P1–P3:设计文档、FS 并发 A+ 定案、FatFs 墙钟接入、cfg_file 双端引擎与 net_cfg 集成(旧档 NCFG 首启迁移)

This commit is contained in:
2026-09-14 02:15:49 +08:00
parent cf2597f998
commit 97661415ca
29 changed files with 3076 additions and 359 deletions
+68
View File
@@ -0,0 +1,68 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="952" viewBox="0 0 1200 952" font-family="Microsoft YaHei, Segoe UI, PingFang SC, sans-serif">
<rect x="0" y="0" width="1200" height="952" fill="#ffffff"/>
<text x="26" y="40" font-size="20" font-weight="700" fill="#0f172a">通用配置文件分层架构(/config.ini)</text>
<text x="26" y="62" font-size="13" fill="#64748b">INI 文本文件 · FTP 上传/下载 · 段键表引擎 · MCU/模拟器双端共享</text>
<rect x="26" y="78" width="1148" height="92" rx="12" fill="#f1f5f9" stroke="#475569" stroke-opacity="0.45"/>
<text x="44" y="104" font-size="17" font-weight="700" fill="#475569">PC 端(外部)</text>
<text x="171" y="104" font-size="12" fill="#64748b">文本编辑器 + FTP 客户端</text>
<rect x="44" y="116" width="362" height="38" rx="8" fill="#ffffff" stroke="#475569" stroke-opacity="0.55"/>
<text x="225" y="139" font-size="13" fill="#1e293b" text-anchor="middle">文本编辑器:改 /config.ini(注释 / 加段 / 改值)</text>
<rect x="416" y="116" width="338" height="38" rx="8" fill="#ffffff" stroke="#475569" stroke-opacity="0.55"/>
<text x="586" y="139" font-size="13" fill="#1e293b" text-anchor="middle">FTP 客户端:RETR 下载 / STOR 上传(端口 21)</text>
<rect x="26" y="214" width="1148" height="92" rx="12" fill="#f5f3ff" stroke="#7c3aed" stroke-opacity="0.45"/>
<text x="44" y="240" font-size="17" font-weight="700" fill="#7c3aed">lftpd FTP 服务(端口 21)</text>
<text x="286" y="240" font-size="12" fill="#64748b">ftpTask · 单连接 · root = /(= 卷根)</text>
<rect x="44" y="252" width="388" height="38" rx="8" fill="#ffffff" stroke="#7c3aed" stroke-opacity="0.55"/>
<text x="238" y="275" font-size="13" fill="#1e293b" text-anchor="middle">RETR / STOR / LIST / DELE / CWD(lftpd 现状能力)</text>
<rect x="442" y="252" width="258" height="38" rx="8" fill="#ffffff" stroke="#7c3aed" stroke-opacity="0.55"/>
<text x="572" y="275" font-size="13" fill="#1e293b" text-anchor="middle">STOR = 原地覆盖(无 tmp+rename)</text>
<rect x="711" y="252" width="179" height="38" rx="8" fill="#ffffff" stroke="#7c3aed" stroke-opacity="0.55"/>
<text x="801" y="275" font-size="13" fill="#1e293b" text-anchor="middle">路径规范化封死 .. 穿越</text>
<rect x="26" y="350" width="1148" height="92" rx="12" fill="#f0fdfa" stroke="#0d9488" stroke-opacity="0.45"/>
<text x="44" y="376" font-size="17" font-weight="700" fill="#0d9488">/config.ini(通用配置文件)</text>
<text x="300" y="376" font-size="12" fill="#64748b">FatFS 卷根(NAND GD5F2GQ5UE · dhara FTL)</text>
<rect x="44" y="388" width="283" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="185" y="411" font-size="13" fill="#1e293b" text-anchor="middle">INI 文本:[段] / key=value / ; 注释</text>
<rect x="337" y="388" width="257" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="466" y="411" font-size="13" fill="#1e293b" text-anchor="middle">CRLF · UTF-8(容忍 BOM)· ≤ 4KB</text>
<rect x="604" y="388" width="394" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="802" y="411" font-size="13" fill="#1e293b" text-anchor="middle">设备写:tmp + rename(原子);变更识别:size + mtime</text>
<rect x="26" y="486" width="1148" height="140" rx="12" fill="#eff6ff" stroke="#2563eb" stroke-opacity="0.45"/>
<text x="44" y="512" font-size="17" font-weight="700" fill="#2563eb">cfg_file(配置文件引擎)</text>
<text x="271" y="512" font-size="12" fill="#64748b">App/cfg_file.c · 双端共享</text>
<rect x="44" y="524" width="325" height="38" rx="8" fill="#ffffff" stroke="#2563eb" stroke-opacity="0.55"/>
<text x="206" y="547" font-size="13" fill="#1e293b" text-anchor="middle">INI 解析 / 序列化(逐键校验 · 容错 · 自愈)</text>
<rect x="379" y="524" width="337" height="38" rx="8" fill="#ffffff" stroke="#2563eb" stroke-opacity="0.55"/>
<text x="547" y="547" font-size="13" fill="#1e293b" text-anchor="middle">外科手术式保存(保留注释 / 未知段 → 降级安全)</text>
<rect x="726" y="524" width="257" height="38" rx="8" fill="#ffffff" stroke="#2563eb" stroke-opacity="0.55"/>
<text x="855" y="547" font-size="13" fill="#1e293b" text-anchor="middle">2s 变更轮询(f_stat)+ 段变更回调</text>
<rect x="44" y="572" width="254" height="38" rx="8" fill="#ffffff" stroke="#2563eb" stroke-opacity="0.55"/>
<text x="171" y="595" font-size="13" fill="#1e293b" text-anchor="middle">出厂模板生成 · 旧 NCFG blob 迁移</text>
<rect x="26" y="670" width="1148" height="92" rx="12" fill="#f0fdf4" stroke="#16a34a" stroke-opacity="0.45"/>
<text x="44" y="696" font-size="17" font-weight="700" fill="#16a34a">段适配(键表)</text>
<text x="175" y="696" font-size="12" fill="#64748b">段 RAM 副本 = 模块静态结构体(稳态 0 增量)</text>
<rect x="44" y="708" width="361" height="38" rx="8" fill="#ffffff" stroke="#16a34a" stroke-opacity="0.55"/>
<text x="224" y="731" font-size="13" fill="#1e293b" text-anchor="middle">net_cfg [network]:ip / mask / gateway / mac</text>
<rect x="415" y="708" width="352" height="38" rx="8" fill="#ffffff" stroke="#16a34a" stroke-opacity="0.55"/>
<text x="591" y="731" font-size="13" fill="#1e293b" text-anchor="middle">未来:[adc] · [rs485] · [ftp] ...(三步接入)</text>
<rect x="26" y="806" width="1148" height="92" rx="12" fill="#fff1f2" stroke="#e11d48" stroke-opacity="0.45"/>
<text x="44" y="832" font-size="17" font-weight="700" fill="#e11d48">消费者</text>
<text x="107" y="832" font-size="12" fill="#64748b">读 / 写段 RAM 副本 + 应用</text>
<rect x="44" y="844" width="263" height="38" rx="8" fill="#ffffff" stroke="#e11d48" stroke-opacity="0.55"/>
<text x="175" y="867" font-size="13" fill="#1e293b" text-anchor="middle">netTask:组网 / 重建(代次号自愈)</text>
<rect x="317" y="844" width="320" height="38" rx="8" fill="#ffffff" stroke="#e11d48" stroke-opacity="0.55"/>
<text x="477" y="867" font-size="13" fill="#1e293b" text-anchor="middle">UI 网口设置页:显示 / 编辑 / 保存(零改动)</text>
<rect x="648" y="844" width="329" height="38" rx="8" fill="#ffffff" stroke="#e11d48" stroke-opacity="0.55"/>
<text x="813" y="867" font-size="13" fill="#1e293b" text-anchor="middle">未来模块:cfg_file_section_data() 取段数据</text>
<line x1="600.0" y1="176.0" x2="600.0" y2="199.0" stroke="#94a3b8" stroke-width="2.5"/>
<path d="M 600.0 206.0 l -6 -9 h 12 z" fill="#94a3b8"/>
<line x1="600.0" y1="312.0" x2="600.0" y2="335.0" stroke="#94a3b8" stroke-width="2.5"/>
<path d="M 600.0 342.0 l -6 -9 h 12 z" fill="#94a3b8"/>
<line x1="600.0" y1="448.0" x2="600.0" y2="471.0" stroke="#94a3b8" stroke-width="2.5"/>
<path d="M 600.0 478.0 l -6 -9 h 12 z" fill="#94a3b8"/>
<line x1="600.0" y1="632.0" x2="600.0" y2="655.0" stroke="#94a3b8" stroke-width="2.5"/>
<path d="M 600.0 662.0 l -6 -9 h 12 z" fill="#94a3b8"/>
<line x1="600.0" y1="768.0" x2="600.0" y2="791.0" stroke="#94a3b8" stroke-width="2.5"/>
<path d="M 600.0 798.0 l -6 -9 h 12 z" fill="#94a3b8"/>
<text x="26" y="934" font-size="12" fill="#94a3b8">稳态 RAM 零增量(段数据 = 模块既有结构体);暂态堆缓冲 ≤9KB(仅 load/save 时);FF_FS_REENTRANT=1 卷锁串行化多任务 FS 访问;模拟器端 = 宿主文件 sim_config.ini(同核心)</text>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

+14 -14
View File
@@ -31,18 +31,16 @@
<text x="935" y="240" font-size="12" fill="#64748b">应用侧服务 / 编排</text>
<rect x="811" y="252" width="170" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="896" y="275" font-size="13" fill="#1e293b" text-anchor="middle">app_main(启动编排)</text>
<rect x="991" y="252" width="177" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1080" y="275" font-size="13" fill="#1e293b" text-anchor="middle">sys_clock(墙钟基准)</text>
<rect x="1179" y="252" width="185" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1271" y="275" font-size="13" fill="#1e293b" text-anchor="middle">sys_events(就绪屏障)</text>
<rect x="811" y="300" width="162" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="892" y="323" font-size="13" fill="#1e293b" text-anchor="middle">app_cfg(编译开关)</text>
<rect x="983" y="300" width="276" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1122" y="323" font-size="13" fill="#1e293b" text-anchor="middle">task/(net · ui · adc* · rs485*)</text>
<rect x="1270" y="300" width="148" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1344" y="323" font-size="13" fill="#1e293b" text-anchor="middle">lftpd(FTP :21)</text>
<rect x="811" y="348" width="227" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="924" y="371" font-size="13" fill="#1e293b" text-anchor="middle">time_sync(TCP 对时 :8888)</text>
<rect x="991" y="252" width="185" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1084" y="275" font-size="13" fill="#1e293b" text-anchor="middle">sys_events(就绪屏障)</text>
<rect x="1186" y="252" width="162" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1268" y="275" font-size="13" fill="#1e293b" text-anchor="middle">app_cfg(编译开关)</text>
<rect x="811" y="300" width="276" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="949" y="323" font-size="13" fill="#1e293b" text-anchor="middle">task/(net · ui · adc* · rs485*)</text>
<rect x="1097" y="300" width="148" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1171" y="323" font-size="13" fill="#1e293b" text-anchor="middle">lftpd(FTP :21)</text>
<rect x="1256" y="300" width="227" height="38" rx="8" fill="#ffffff" stroke="#0d9488" stroke-opacity="0.55"/>
<text x="1369" y="323" font-size="13" fill="#1e293b" text-anchor="middle">time_sync(TCP 对时 :8888)</text>
<rect x="26" y="446" width="1508" height="92" rx="12" fill="#f0fdf4" stroke="#16a34a" stroke-opacity="0.45"/>
<text x="44" y="472" font-size="17" font-weight="700" fill="#16a34a">④ 中间件层</text>
<text x="151" y="472" font-size="12" fill="#64748b">通用库 / 协议栈</text>
@@ -54,8 +52,10 @@
<text x="588" y="507" font-size="13" fill="#1e293b" text-anchor="middle">nand_ftl(dhara FTL)</text>
<rect x="692" y="484" width="164" height="38" rx="8" fill="#ffffff" stroke="#16a34a" stroke-opacity="0.55"/>
<text x="774" y="507" font-size="13" fill="#1e293b" text-anchor="middle">LVGL v9.2(图形库)</text>
<rect x="866" y="484" width="186" height="38" rx="8" fill="#ffffff" stroke="#16a34a" stroke-opacity="0.55"/>
<text x="960" y="507" font-size="13" fill="#1e293b" text-anchor="middle">util(crc · ringbuf)</text>
<rect x="866" y="484" width="177" height="38" rx="8" fill="#ffffff" stroke="#16a34a" stroke-opacity="0.55"/>
<text x="955" y="507" font-size="13" fill="#1e293b" text-anchor="middle">sys_clock(墙钟基准)</text>
<rect x="1054" y="484" width="186" height="38" rx="8" fill="#ffffff" stroke="#16a34a" stroke-opacity="0.55"/>
<text x="1147" y="507" font-size="13" fill="#1e293b" text-anchor="middle">util(crc · ringbuf)</text>
<rect x="26" y="582" width="1508" height="92" rx="12" fill="#fffbeb" stroke="#d97706" stroke-opacity="0.45"/>
<text x="44" y="608" font-size="17" font-weight="700" fill="#d97706">⑤ 驱动层</text>
<text x="134" y="608" font-size="12" fill="#64748b">Drivers/BSP · 芯片时序/中断</text>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB