shibosoftwaredev/f1c100s-linux-nema17-stepper-controller

A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.

Version
0.4.56
License
unset
Stars
0

scripts/install-swap.mjs

import fs from "node:fs"
import assert from "node:assert/strict"
import crypto from "node:crypto"
import {routingSignature} from "../routing-signature"
const read=p=>JSON.parse(fs.readFileSync(p,"utf8"))
const sha=p=>crypto.createHash("sha256").update(fs.readFileSync(p)).digest("hex")
const imported=read("routing/swap-import/import-report.json")
assert.deepEqual(imported.failures,[])
assert.equal(imported.physical_island_links,0)
assert.equal(imported.audit_only,false)
assert.equal(imported.ignored_protected,false)
assert.equal(imported.circuit_sha256,sha("routing/review-placement.circuit.json"))
assert.equal(imported.session_sha256,sha("routing/bulk-top-closure-candidate.ses"))
const checked=read("reports/swap-final/coil-all-copper-preflight-meta.json")
assert.deepEqual(read("reports/swap-final/coil-all-copper-preflight.json"),[])
assert.equal(checked.circuitSha256,sha("routing/review-placement.circuit.json"))
assert.equal(checked.physicalCopperSha256,sha("routing/bulk-top-closure-physical-candidate.json"))
const placement=read("routing/review-placement.circuit.json")
assert.deepEqual(placement.filter(e=>e.type.endsWith("_error")),[])
const cap=placement.find(e=>e.type==="source_component"&&e.name==="C_VM_BULK")
assert.equal(placement.find(e=>e.type==="pcb_component"&&e.source_component_id===cap.source_component_id).layer,"top")
for(const [p,v] of [["routing/complete-routes.json",read("routing/swap-import/complete-routes.json")],["routing/expected-input.json",routingSignature(placement)],["routing/placement.json",placement]])
  fs.writeFileSync(p,JSON.stringify(v,null,2)+"\n")
console.log("Candidate routes installed only in the isolated trial; full built-board regression checks still required.")