astra/pd-power-supply

USB-PD Power Supply with RP2040 controller

Version
1.1.6
License
unset
Stars
0

routing.ts

import savedRoutes from './routing/board-routes.json'
// Verified copper for this board placement. Dedicated power paths remain explicit
// in board.circuit.tsx. The adapter returns saved signal/bypass routes through the
// normal tscircuit routing phase, so connectivity and copper DRC remain enabled.
export async function routeProtectedPads(input:any) {
  const traces=savedRoutes.map(t=>({...t,route:t.route.map(p=>({...p}))}))
  const handlers:Record<string,((event:any)=>void)[]>={complete:[],error:[],progress:[]}
  return {
    on:(event:string,handler:(event:any)=>void)=>handlers[event].push(handler),
    start:()=>setTimeout(()=>handlers.complete.forEach(fn=>fn({traces})),0),
    stop:()=>{},
    getOutputSimpleRouteJson:()=>({...input,traces:[...(input.traces??[]),...traces]}),
  }
}