Skip to content

Commit b8c5355

Browse files
authored
Merge pull request #353 from brentru/add-agnostic-board
Add support for OS-agnostic board (CI runner)
2 parents 2e1f0a2 + 4d3bbdf commit b8c5355

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

adafruit_platformdetect/board.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def id(self) -> Optional[str]:
6565
board_id = self._armbian_id() or self._allwinner_variants_id()
6666
elif chip_id == chips.BCM2XXX:
6767
board_id = self._pi_id()
68+
elif chip_id == chips.OS_AGNOSTIC:
69+
board_id = boards.OS_AGNOSTIC_BOARD
6870
elif chip_id == chips.AM625X:
6971
board_id = self._beaglebone_id()
7072
elif chip_id == chips.AM33XX:
@@ -1036,6 +1038,7 @@ def lazily_generate_conditions():
10361038
yield self.board.QTPY_U2IF
10371039
yield self.board.QT2040_TRINKEY_U2IF
10381040
yield self.board.KB2040_U2IF
1041+
yield self.board.OS_AGNOSTIC_BOARD
10391042

10401043
return any(condition for condition in lazily_generate_conditions())
10411044

@@ -1105,6 +1108,11 @@ def microchip_mcp2221(self) -> bool:
11051108
"""Check whether the current board is a Microchip MCP2221."""
11061109
return self.id == boards.MICROCHIP_MCP2221
11071110

1111+
@property
1112+
def os_agnostic_board(self) -> bool:
1113+
"""Check whether the current board is an OS agnostic special case."""
1114+
return self.id == boards.OS_AGNOSTIC_BOARD
1115+
11081116
@property
11091117
def pico_u2if(self) -> bool:
11101118
"""Check whether the current board is a RPi Pico w/ u2if."""

adafruit_platformdetect/chip.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def id(
9898
"BLINKA_MCP2221 environment variable "
9999
+ "set, but no MCP2221 device found"
100100
)
101+
if os.environ.get("BLINKA_OS_AGNOSTIC"):
102+
# we don't need to look for this chip, it's just a flag
103+
self._chip_id = chips.OS_AGNOSTIC
104+
return self._chip_id
101105
if os.environ.get("BLINKA_U2IF"):
102106
import hid
103107

adafruit_platformdetect/constants/boards.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,6 @@
596596
LUCKFOX_PICO_MAX,
597597
LUCKFOX_PICO_MINI,
598598
)
599+
600+
# Agnostic board
601+
OS_AGNOSTIC_BOARD = "OS_AGNOSTIC_BOARD"

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
"""Definition of chips."""
66
A311D = "A311D"
7+
OS_AGNOSTIC = "OS_AGNOSTIC"
78
AM33XX = "AM33XX"
89
AM625X = "AM625X"
910
AM65XX = "AM65XX"

0 commit comments

Comments
 (0)