abse/gameboy-advance

Validates and exports a four-layer Game Boy–style PCB assembly with RP2350 MCU, 32MB flash, USB-C, LCD and speaker connectors, battery buck-boost power, buttons, and verified routing, connectivity, clearances, CAD models, and physical DRC.

Version
0.0.39
License
unset
Stars
0

checks/run-validated.ts

PCBPCB preview for checks/run-validated.ts
SchematicSchematic preview for checks/run-validated.ts
import {readFileSync} from 'node:fs'
const started=Date.now()
const child=Bun.spawn([process.execPath,'checks/build-validated.ts'],{cwd:process.cwd(),env:process.env,stdin:'ignore',stdout:'inherit',stderr:'inherit'})
const heartbeat=setInterval(()=>{
 let rssMB:number|undefined
 try{const match=readFileSync(`/proc/${child.pid}/status`,'utf8').match(/^VmRSS:\s+(\d+) kB/m);if(match)rssMB=Math.round(Number(match[1])/1024)}catch{}
 console.log('Native validation still running',JSON.stringify({elapsedSeconds:Math.round((Date.now()-started)/1000),rssMB}))
},20000)
try{const exitCode=await child.exited;clearInterval(heartbeat);process.exit(exitCode)}finally{clearInterval(heartbeat)}