fix(spice): map micro:bit-style P<n> pad names to pin numbers

The netlist collector only understood GPIO<n>/GP<n>/bare digits, so a
wire on a QEMU-Linux board's P24 Gravity pad never got its V-source
stamped and the LED stayed dark while the guest toggled the pin.
This commit is contained in:
David Montero Crespo 2026-07-28 22:35:46 +02:00
parent 7da01c6a91
commit 8163869d31
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,11 @@ export function pinNameToArduinoPin(pinName: string, boardKind: BoardKind): numb
if (/^PB\d+$/.test(pinName)) {
return parseInt(pinName.slice(2), 10);
}
// micro:bit-style pad names (P0..P25) used by QEMU-Linux SBC edges and
// Gravity ports (e.g. the UNIHIKER's P24). Must come after the PB test.
if (/^P\d+$/.test(pinName)) {
return parseInt(pinName.slice(1), 10);
}
if (/^\d+$/.test(pinName)) {
return parseInt(pinName, 10);
}