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/write-swap-status.mjs

import fs from "node:fs"
import assert from "node:assert/strict"
import crypto from "node:crypto"
const read=p=>JSON.parse(fs.readFileSync(p,"utf8"))
const sha=p=>crypto.createHash("sha256").update(fs.readFileSync(p)).digest("hex")
const accepted="../f1c100s-linux-nema17-review-v053-rRqNFa"
const c=read("routing/review-placement.circuit.json")
assert.deepEqual(c.filter(e=>e.type.endsWith("_error")),[])
const states=read("reports/bulk-top-physical-islands.json")
const cap=c.find(e=>e.type==="source_component"&&e.name==="C_VM_BULK")
const pcb=c.find(e=>e.type==="pcb_component"&&e.source_component_id===cap.source_component_id)
assert.equal(pcb.layer,"top")
const protectedFiles=["routing/complete-routes.json","routing/expected-input.json","dist/index/circuit.json"]
for(const p of protectedFiles)assert.equal(sha(p),sha(accepted+"/"+p))
const report={checkedAt:new Date().toISOString(),status:"unvalidated_hardware_trial_not_accepted",published:false,
  fabricationReady:false,placementErrors:0,capacitorLayer:"top",tvSLayer:"bottom",
  unresolvedConnections:states.jobs.length,disconnectedNets:states.islands,
  provisionalAdcAddedLengthMm:120.80254824628683,
  rejectedReasons:["Whole-board physical source connectivity is incomplete.","Provisional ADC routing is excessively long; not accepted as a regression-free replacement."],
  acceptedWorkingDirectory:fs.realpathSync(accepted),acceptedWorkingBoardUnchanged:true,
  acceptedFilesSha256:Object.fromEntries(protectedFiles.map(p=>[p,sha(accepted+"/"+p)])),
  trialPlacementSha256:sha("routing/review-placement.circuit.json"),trialPartialCopperSha256:sha("routing/swap-progress-physical.json"),
  warning:"Inherited dist, verification.json and historical validation reports describe the old working board, not this altered hardware source. No complete routed build or fabrication signoff was obtained for this trial."}
fs.writeFileSync("reports/swap-attempt-status.json",JSON.stringify(report,null,2)+"\n")
console.log(JSON.stringify(report))