fix(boards): isBoardComponent recognizes overlay-registered boards (CP3)
A wire to a pro board's Dx pad (XIAO 'D2', etc.) did nothing because isBoardComponent only knew the OSS board-id list, so the electrical/sensor chain skipped the board endpoint. It now also returns true for any proBoardRegistry kind, so boardPinToNumber (which already consults the pro def's pinToNumber) resolves the Dx name. Fixes the numeric-alias-only workaround in the XIAO examples.
This commit is contained in:
parent
c819fea74b
commit
4392a91539
|
|
@ -243,7 +243,14 @@ export const BOARD_COMPONENT_IDS = [
|
|||
* Check whether a componentId represents a board (not an external component).
|
||||
*/
|
||||
export function isBoardComponent(componentId: string): boolean {
|
||||
return BOARD_COMPONENT_IDS.some((id) => componentId === id || componentId.startsWith(id));
|
||||
if (BOARD_COMPONENT_IDS.some((id) => componentId === id || componentId.startsWith(id))) {
|
||||
return true;
|
||||
}
|
||||
// Overlay-registered boards (proBoardRegistry) are boards too — recognized
|
||||
// without listing their closed names in the OSS array. This is what lets a
|
||||
// wire to a pro board's Dx pad resolve through boardPinToNumber (which also
|
||||
// consults the pro def), fixing the "wire to D2 does nothing" case.
|
||||
return getProBoard(componentId) !== undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue