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:
parent
7da01c6a91
commit
8163869d31
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue