Skip to content

Commit

Permalink
Merge pull request #57 from tscircuit/fix/arduino-nano
Browse files Browse the repository at this point in the history
fix: get the unconnected pads as well in nets list
  • Loading branch information
imrishabh18 authored Dec 9, 2024
2 parents c0a3968 + a434061 commit 1c631de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/dsn-pcb/circuit-json-to-dsn-json/process-nets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export function processNets(circuitElements: AnyCircuitElement[], pcb: DsnPcb) {
if (sourcePort && "source_component_id" in sourcePort) {
const componentName =
componentNameMap.get(sourcePort.source_component_id) || ""
// "A12" -> "12", "B1" -> "1 (When pinNumber a)
const pinNumber =
element.port_hints?.[0]?.match(/(?:A|B)?(\d+)/)?.[1] || "1"
const pinNumber = sourcePort.port_hints?.find(
(hint) => !Number.isNaN(Number(hint)),
)

padsBySourcePortId.set(sourcePort.source_port_id, {
componentName,
Expand Down
2 changes: 1 addition & 1 deletion tests/repros/repro-4-arduino-nano.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ test("circuit json (arduino nano) -> dsn file", async () => {
// padstack length
expect(dsnJson.library.padstacks.length).toBe(10)
// net length
expect(dsnJson.network.nets.length).toBe(63)
expect(dsnJson.network.nets.length).toBe(72)
})

0 comments on commit 1c631de

Please sign in to comment.