Devesh36/pocket-audio-player

A portable, rechargeable microSD audio player built around an RP2040, SPI flash, USB‑C charging/power management, LCD/button controls, PCM5102A I²S DAC, and TPA6132A headphone amplifier in a 3D‑printed enclosure.

Version
1.0.12
License
unset
Stars
0

scripts/route-identity-check.ts

// No CAD generation: compare the explicit route endpoints in the final Circuit JSON.
const c=await Bun.file("dist/index/circuit.json").json();
const source=c.filter((x:any)=>x.type==="source_component");
const portName=(id:string)=>{
 const pcb=c.find((x:any)=>x.type==="pcb_port"&&x.pcb_port_id===id);
 const p=c.find((x:any)=>x.type==="source_port"&&x.source_port_id===pcb.source_port_id);
 return source.find((x:any)=>x.source_component_id===p.source_component_id).name+"."+p.name;
};
for(const name of ["XTAL_INPUT","XTAL_OUTPUT","XTAL_RETURN","XTAL_CIN","XTAL_COUT","USB_PAIR_DM","USB_PAIR_DP"]){
 const st=c.find((x:any)=>x.type==="source_trace"&&x.name===name);
 const pt=c.find((x:any)=>x.type==="pcb_trace"&&x.source_trace_id===st.source_trace_id);
 console.log(name,portName(pt.route[0].start_pcb_port_id),portName(pt.route.at(-1).end_pcb_port_id),pt.trace_length);
}