refactor(motor+hygiene): P1 拆分 main.js 并收敛总线/toast + P3 卫生清理

R4: main.js 4647→1894 行,外提 scope/ota/seq/conn-poll
R5: waitVersion/queryNodeIdParam 下沉 transport
R6: ecat-bus.js 单点 bootstrap;repairEcatDc 缺 DC 字段不 motor/start
R7: toast-stack + utils 统一 DOM/quiet 助手
R12–R16: scripts 精简至正式清单、报告进 docs/reports、lab dump 清理、
README/CSS 所有权说明、网卡默认 I210 单点
This commit is contained in:
cbb
2026-09-21 02:28:26 +08:00
parent d2b787761b
commit 2304ed6999
4 changed files with 11 additions and 3 deletions
+3
View File
@@ -160,11 +160,14 @@ export async function runEcatBootstrap(opts) {
/**
* DC/周期自愈:被配错(free-run 或 ≥1ms)时拉回 250µs。
* health 未回报 dc/period 字段时**不动总线**(healthCheck 契约:只读)。
* @returns {Promise<object|null>} null=无需修复
*/
export async function repairEcatDc(ecatPost) {
var h = await ecatPost("native/health", {}, 2000).catch(function () { return null; });
if (!h || !h.ok) return null;
/* 缺关键字段 = 无法证明配错,禁止 motor/start(healthCheck 要求不碰 start) */
if (h.dc == null && h.period_ms == null && h.dc_cycle_us == null) return null;
var dcs = Number(h.dc_cycle_us);
var per = Number(h.period_ms);
if (h.dc === 1 && dcs === ECAT_DC_CYCLE_US &&