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-usb-top.mjs

import fs from "node:fs"
import assert from "node:assert/strict"
import crypto from "node:crypto"
import {routingSignature} from "../routing-signature"
const baseline="../../checkpoints/nema17-before-usb-top-v052-UkdpHy/restore-verified"
const read=p=>JSON.parse(fs.readFileSync(p,"utf8"))
const write=(p,v)=>fs.writeFileSync(p,JSON.stringify(v,null,2)+"\n")
const sha=p=>crypto.createHash("sha256").update(fs.readFileSync(p)).digest("hex")
if(process.argv.includes("--clock-seed")){
  write("routing/review-clock.json",read(baseline+"/routing/complete-routes.json").filter(t=>["source_trace_18","source_trace_19"].includes(t.source_trace_id)))
}else{
  const report=read("routing/usb-top-import/import-report.json")
  assert.deepEqual(report.failures,[])
  assert.equal(report.physical_island_links,0)
  assert.deepEqual(read("reports/usb-top-preflight/coil-all-copper-preflight.json"),[])
  const checked=read("reports/usb-top-preflight/coil-all-copper-preflight-meta.json")
  assert.equal(checked.circuitSha256,sha("routing/usb-top-placement.circuit.json"))
  assert.equal(checked.physicalCopperSha256,sha("routing/usb-top-physical-candidate.json"))
  const placement=read("routing/usb-top-placement.circuit.json")
  write("routing/complete-routes.json",read("routing/usb-top-import/complete-routes.json"))
  write("routing/expected-input.json",routingSignature(placement))
  write("routing/placement.json",placement)
}